Mercurial > urweb
diff src/mono_opt.sml @ 2224:5709482a2afd
Merge.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Thu, 11 Dec 2014 02:05:41 -0500 |
parents | 278e10629ba1 fd6d362666c0 |
children | e10881cd92da |
line wrap: on
line diff
--- a/src/mono_opt.sml Sat Nov 29 04:34:41 2014 -0500 +++ b/src/mono_opt.sml Thu Dec 11 02:05:41 2014 -0500 @@ -167,6 +167,9 @@ | EFfiApp ("Basis", "strcat", [(e1, _), (e2, _)]) => exp (EStrcat (e1, e2)) + | EStrcat (e1, (EPrim (Prim.String (_, "")), _)) => #1 e1 + | EStrcat ((EPrim (Prim.String (_, "")), _), e2) => #1 e2 + | EStrcat ((EPrim (Prim.String (Prim.Html, s1)), loc), (EPrim (Prim.String (Prim.Html, s2)), _)) => let val s = @@ -220,6 +223,11 @@ | EWrite (EFfiApp ("Basis", "htmlifySpecialChar", [e]), _) => EFfiApp ("Basis", "htmlifySpecialChar_w", [e]) + | EWrite (EFfiApp ("Basis", "intToString", [e]), _) => + EFfiApp ("Basis", "htmlifyInt_w", [e]) + | EApp ((EFfi ("Basis", "intToString"), loc), e) => + EFfiApp ("Basis", "intToString", [(e, (TFfi ("Basis", "int"), loc))]) + | EFfiApp ("Basis", "htmlifyString", [((EFfiApp ("Basis", "intToString", [((EPrim (Prim.Int n), _), _)]), _), _)]) => EPrim (Prim.String (Prim.Html, htmlifyInt n)) | EFfiApp ("Basis", "htmlifyString", [((EFfiApp ("Basis", "intToString", es), _), _)]) => @@ -621,6 +629,8 @@ EFfiApp ("Basis", "attrifyChar", [e]) | EFfiApp ("Basis", "attrifyString_w", [((EFfiApp ("Basis", "str1", [e]), _), _)]) => EFfiApp ("Basis", "attrifyChar_w", [e]) + | EWrite (EFfiApp ("Basis", "str1", [e]), _) => + EFfiApp ("Basis", "writec", [e]) | EBinop (_, "+", (EPrim (Prim.Int n1), _), (EPrim (Prim.Int n2), _)) => EPrim (Prim.Int (Int64.+ (n1, n2)))