comparison src/monoize.sml @ 1817:148203744882

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 b8558b613abd
children 36428d853c97
comparison
equal deleted inserted replaced
1816:ae8b0e05522a 1817:148203744882
3261 fun tagStart tag' = 3261 fun tagStart tag' =
3262 let 3262 let
3263 val t = (L'.TFfi ("Basis", "string"), loc) 3263 val t = (L'.TFfi ("Basis", "string"), loc)
3264 val s = (L'.EPrim (Prim.String (String.concat ["<", tag'])), loc) 3264 val s = (L'.EPrim (Prim.String (String.concat ["<", tag'])), loc)
3265 3265
3266 val s = (L'.ECase (class, 3266 val s = (L'.EStrcat (s,
3267 [((L'.PPrim (Prim.String ""), loc), 3267 (L'.ECase (class,
3268 s), 3268 [((L'.PPrim (Prim.String ""), loc),
3269 ((L'.PVar ("x", t), loc), 3269 (L'.EPrim (Prim.String ""), loc)),
3270 (L'.EStrcat (s, 3270 ((L'.PVar ("x", t), loc),
3271 (L'.EStrcat ((L'.EPrim (Prim.String " class=\""), loc), 3271 (L'.EStrcat ((L'.EPrim (Prim.String " class=\""), loc),
3272 (L'.EStrcat ((L'.ERel 0, loc), 3272 (L'.EStrcat ((L'.ERel 0, loc),
3273 (L'.EPrim (Prim.String "\""), loc)), 3273 (L'.EPrim (Prim.String "\""), loc)),
3274 loc)), loc)), loc))], 3274 loc)), loc))],
3275 {disc = t, 3275 {disc = t,
3276 result = t}), loc) 3276 result = t}), loc)), loc)
3277 3277
3278 val s = (L'.ECase (style, 3278 val s = (L'.EStrcat (s,
3279 [((L'.PPrim (Prim.String ""), loc), 3279 (L'.ECase (style,
3280 s), 3280 [((L'.PPrim (Prim.String ""), loc),
3281 ((L'.PVar ("x", t), loc), 3281 (L'.EPrim (Prim.String ""), loc)),
3282 (L'.EStrcat (s, 3282 ((L'.PVar ("x", t), loc),
3283 (L'.EStrcat ((L'.EPrim (Prim.String " style=\""), loc), 3283 (L'.EStrcat ((L'.EPrim (Prim.String " style=\""), loc),
3284 (L'.EStrcat ((L'.ERel 0, loc), 3284 (L'.EStrcat ((L'.ERel 0, loc),
3285 (L'.EPrim (Prim.String "\""), loc)), 3285 (L'.EPrim (Prim.String "\""), loc)),
3286 loc)), loc)), loc))], 3286 loc)), loc))],
3287 {disc = t, 3287 {disc = t,
3288 result = t}), loc) 3288 result = t}), loc)), loc)
3289 3289
3290 val (s, fm) = foldl (fn (("Action", _, _), acc) => acc 3290 val (s, fm) = foldl (fn (("Action", _, _), acc) => acc
3291 | (("Source", _, _), acc) => acc 3291 | (("Source", _, _), acc) => acc
3292 | ((x, e, t), (s, fm)) => 3292 | ((x, e, t), (s, fm)) =>
3293 case t of 3293 case t of