Skip to content

Commit

Permalink
Add constant-folding rule for String.^
Browse files Browse the repository at this point in the history
  • Loading branch information
minoki committed Sep 12, 2024
1 parent 07a42ac commit d092af4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cps/inline.sml
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,13 @@ struct
| _ => NOT_SIMPLIFIED)
| (F.PrimCall P.String_EQUAL, [C.StringConst x, C.StringConst y]) =>
VALUE (C.BoolConst (x = y))
| (F.PrimCall P.String_HAT, [C.StringConst x, C.StringConst y]) =>
VALUE (C.StringConst (x ^ y))
| ( F.PrimCall P.String16_EQUAL
, [C.String16Const x, C.String16Const y]
) => VALUE (C.BoolConst (x = y))
| (F.PrimCall P.String16_HAT, [C.String16Const x, C.String16Const y]) =>
VALUE (C.String16Const (Vector.concat [x, y]))
| ( F.PrimCall (P.Int_EQUAL w)
, [C.IntConst (w', x), C.IntConst (w'', y)]
) =>
Expand Down

0 comments on commit d092af4

Please sign in to comment.