comparison 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
comparison
equal deleted inserted replaced
2223:9410959d296f 2224:5709482a2afd
165 else 165 else
166 e 166 e
167 167
168 | EFfiApp ("Basis", "strcat", [(e1, _), (e2, _)]) => exp (EStrcat (e1, e2)) 168 | EFfiApp ("Basis", "strcat", [(e1, _), (e2, _)]) => exp (EStrcat (e1, e2))
169 169
170 | EStrcat (e1, (EPrim (Prim.String (_, "")), _)) => #1 e1
171 | EStrcat ((EPrim (Prim.String (_, "")), _), e2) => #1 e2
172
170 | EStrcat ((EPrim (Prim.String (Prim.Html, s1)), loc), (EPrim (Prim.String (Prim.Html, s2)), _)) => 173 | EStrcat ((EPrim (Prim.String (Prim.Html, s1)), loc), (EPrim (Prim.String (Prim.Html, s2)), _)) =>
171 let 174 let
172 val s = 175 val s =
173 if size s1 > 0 andalso size s2 > 0 176 if size s1 > 0 andalso size s2 > 0
174 andalso Char.isSpace (String.sub (s1, size s1 - 1)) 177 andalso Char.isSpace (String.sub (s1, size s1 - 1))
217 220
218 | EFfiApp ("Basis", "htmlifySpecialChar", [((EPrim (Prim.Char ch), _), _)]) => 221 | EFfiApp ("Basis", "htmlifySpecialChar", [((EPrim (Prim.Char ch), _), _)]) =>
219 EPrim (Prim.String (Prim.Html, htmlifySpecialChar ch)) 222 EPrim (Prim.String (Prim.Html, htmlifySpecialChar ch))
220 | EWrite (EFfiApp ("Basis", "htmlifySpecialChar", [e]), _) => 223 | EWrite (EFfiApp ("Basis", "htmlifySpecialChar", [e]), _) =>
221 EFfiApp ("Basis", "htmlifySpecialChar_w", [e]) 224 EFfiApp ("Basis", "htmlifySpecialChar_w", [e])
225
226 | EWrite (EFfiApp ("Basis", "intToString", [e]), _) =>
227 EFfiApp ("Basis", "htmlifyInt_w", [e])
228 | EApp ((EFfi ("Basis", "intToString"), loc), e) =>
229 EFfiApp ("Basis", "intToString", [(e, (TFfi ("Basis", "int"), loc))])
222 230
223 | EFfiApp ("Basis", "htmlifyString", [((EFfiApp ("Basis", "intToString", [((EPrim (Prim.Int n), _), _)]), _), _)]) => 231 | EFfiApp ("Basis", "htmlifyString", [((EFfiApp ("Basis", "intToString", [((EPrim (Prim.Int n), _), _)]), _), _)]) =>
224 EPrim (Prim.String (Prim.Html, htmlifyInt n)) 232 EPrim (Prim.String (Prim.Html, htmlifyInt n))
225 | EFfiApp ("Basis", "htmlifyString", [((EFfiApp ("Basis", "intToString", es), _), _)]) => 233 | EFfiApp ("Basis", "htmlifyString", [((EFfiApp ("Basis", "intToString", es), _), _)]) =>
226 EFfiApp ("Basis", "htmlifyInt", es) 234 EFfiApp ("Basis", "htmlifyInt", es)
619 EPrim (Prim.String (Prim.Normal, str ch)) 627 EPrim (Prim.String (Prim.Normal, str ch))
620 | EFfiApp ("Basis", "attrifyString", [((EFfiApp ("Basis", "str1", [e]), _), _)]) => 628 | EFfiApp ("Basis", "attrifyString", [((EFfiApp ("Basis", "str1", [e]), _), _)]) =>
621 EFfiApp ("Basis", "attrifyChar", [e]) 629 EFfiApp ("Basis", "attrifyChar", [e])
622 | EFfiApp ("Basis", "attrifyString_w", [((EFfiApp ("Basis", "str1", [e]), _), _)]) => 630 | EFfiApp ("Basis", "attrifyString_w", [((EFfiApp ("Basis", "str1", [e]), _), _)]) =>
623 EFfiApp ("Basis", "attrifyChar_w", [e]) 631 EFfiApp ("Basis", "attrifyChar_w", [e])
632 | EWrite (EFfiApp ("Basis", "str1", [e]), _) =>
633 EFfiApp ("Basis", "writec", [e])
624 634
625 | EBinop (_, "+", (EPrim (Prim.Int n1), _), (EPrim (Prim.Int n2), _)) => EPrim (Prim.Int (Int64.+ (n1, n2))) 635 | EBinop (_, "+", (EPrim (Prim.Int n1), _), (EPrim (Prim.Int n2), _)) => EPrim (Prim.Int (Int64.+ (n1, n2)))
626 636
627 | _ => e 637 | _ => e
628 638