Mercurial > urweb
comparison src/jscomp.sml @ 847:0f7e2cca6d9b
<dyn> inside <table>; fix Specialize bug with datatype decls generating other mutually-recursive datatype decls
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 13 Jun 2009 14:29:36 -0400 |
parents | 44c2c089ca15 |
children | 1c2f335297b7 |
comparison
equal
deleted
inserted
replaced
846:0d30e6338c65 | 847:0f7e2cca6d9b |
---|---|
168 case b of | 168 case b of |
169 U.Exp.RelE _ => inner+1 | 169 U.Exp.RelE _ => inner+1 |
170 | _ => inner} | 170 | _ => inner} |
171 | 171 |
172 exception CantEmbed of typ | 172 exception CantEmbed of typ |
173 | |
174 fun inString {needle, haystack} = | |
175 let | |
176 val (_, suffix) = Substring.position needle (Substring.full haystack) | |
177 in | |
178 not (Substring.isEmpty suffix) | |
179 end | |
173 | 180 |
174 fun process file = | 181 fun process file = |
175 let | 182 let |
176 val (someTs, nameds) = | 183 val (someTs, nameds) = |
177 foldl (fn ((DVal (_, n, t, e, _), _), (someTs, nameds)) => (someTs, IM.insert (nameds, n, e)) | 184 foldl (fn ((DVal (_, n, t, e, _), _), (someTs, nameds)) => (someTs, IM.insert (nameds, n, e)) |
1084 | PSome (_, p) => patBinds (p, env) | 1091 | PSome (_, p) => patBinds (p, env) |
1085 | 1092 |
1086 fun exp outer (e as (_, loc), st) = | 1093 fun exp outer (e as (_, loc), st) = |
1087 ((*Print.preface ("exp", MonoPrint.p_exp MonoEnv.empty e);*) | 1094 ((*Print.preface ("exp", MonoPrint.p_exp MonoEnv.empty e);*) |
1088 case #1 e of | 1095 case #1 e of |
1089 EPrim _ => (e, st) | 1096 EPrim p => |
1097 (case p of | |
1098 Prim.String s => if inString {needle = "<script", haystack = s} then | |
1099 foundJavaScript := true | |
1100 else | |
1101 () | |
1102 | _ => (); | |
1103 (e, st)) | |
1090 | ERel _ => (e, st) | 1104 | ERel _ => (e, st) |
1091 | ENamed _ => (e, st) | 1105 | ENamed _ => (e, st) |
1092 | ECon (_, _, NONE) => (e, st) | 1106 | ECon (_, _, NONE) => (e, st) |
1093 | ECon (dk, pc, SOME e) => | 1107 | ECon (dk, pc, SOME e) => |
1094 let | 1108 let |