comparison src/monoize.sml @ 1804:62c18ecbfec4

Tweaking treatment of function application: substitute or introduce a 'let'?
author Adam Chlipala <adam@chlipala.net>
date Sun, 05 Aug 2012 14:55:28 -0400
parents 38297294cf98
children d12192c7aa3e
comparison
equal deleted inserted replaced
1803:d2383ffc18ab 1804:62c18ecbfec4
3255 fun tagStart tag' = 3255 fun tagStart tag' =
3256 let 3256 let
3257 val t = (L'.TFfi ("Basis", "string"), loc) 3257 val t = (L'.TFfi ("Basis", "string"), loc)
3258 val s = (L'.EPrim (Prim.String (String.concat ["<", tag'])), loc) 3258 val s = (L'.EPrim (Prim.String (String.concat ["<", tag'])), loc)
3259 3259
3260 val s = (L'.ECase (class, 3260 val s = (L'.EStrcat (s,
3261 [((L'.PPrim (Prim.String ""), loc), 3261 (L'.ECase (class,
3262 s), 3262 [((L'.PPrim (Prim.String ""), loc),
3263 ((L'.PVar ("x", t), loc), 3263 (L'.EPrim (Prim.String ""), loc)),
3264 (L'.EStrcat (s, 3264 ((L'.PVar ("x", t), loc),
3265 (L'.EStrcat ((L'.EPrim (Prim.String " class=\""), loc), 3265 (L'.EStrcat ((L'.EPrim (Prim.String " class=\""), loc),
3266 (L'.EStrcat ((L'.ERel 0, loc), 3266 (L'.EStrcat ((L'.ERel 0, loc),
3267 (L'.EPrim (Prim.String "\""), loc)), 3267 (L'.EPrim (Prim.String "\""), loc)),
3268 loc)), loc)), loc))], 3268 loc)), loc))],
3269 {disc = t, 3269 {disc = t,
3270 result = t}), loc) 3270 result = t}), loc)), loc)
3271 3271
3272 val s = (L'.ECase (style, 3272 val s = (L'.EStrcat (s,
3273 [((L'.PPrim (Prim.String ""), loc), 3273 (L'.ECase (style,
3274 s), 3274 [((L'.PPrim (Prim.String ""), loc),
3275 ((L'.PVar ("x", t), loc), 3275 (L'.EPrim (Prim.String ""), loc)),
3276 (L'.EStrcat (s, 3276 ((L'.PVar ("x", t), loc),
3277 (L'.EStrcat ((L'.EPrim (Prim.String " style=\""), loc), 3277 (L'.EStrcat ((L'.EPrim (Prim.String " style=\""), loc),
3278 (L'.EStrcat ((L'.ERel 0, loc), 3278 (L'.EStrcat ((L'.ERel 0, loc),
3279 (L'.EPrim (Prim.String "\""), loc)), 3279 (L'.EPrim (Prim.String "\""), loc)),
3280 loc)), loc)), loc))], 3280 loc)), loc))],
3281 {disc = t, 3281 {disc = t,
3282 result = t}), loc) 3282 result = t}), loc)), loc)
3283 3283
3284 val (s, fm) = foldl (fn (("Action", _, _), acc) => acc 3284 val (s, fm) = foldl (fn (("Action", _, _), acc) => acc
3285 | (("Source", _, _), acc) => acc 3285 | (("Source", _, _), acc) => acc
3286 | ((x, e, t), (s, fm)) => 3286 | ((x, e, t), (s, fm)) =>
3287 case t of 3287 case t of