comparison src/monoize.sml @ 200:5dbba661deab

Urlifying records
author Adam Chlipala <adamc@hcoop.net>
date Sat, 09 Aug 2008 20:08:29 -0400
parents ab86aa858e6c
children 766b5475477f
comparison
equal deleted inserted replaced
199:c938fe391c84 200:5dbba661deab
214 attrify (args, ft, (L'.EPrim (Prim.String ("/" ^ s)), loc), fm) 214 attrify (args, ft, (L'.EPrim (Prim.String ("/" ^ s)), loc), fm)
215 end 215 end
216 | _ => 216 | _ =>
217 case t of 217 case t of
218 L'.TFfi (m, x) => ((L'.EFfiApp (m, fk2s fk ^ "ify" ^ capitalize x, [e]), loc), fm) 218 L'.TFfi (m, x) => ((L'.EFfiApp (m, fk2s fk ^ "ify" ^ capitalize x, [e]), loc), fm)
219
219 | L'.TRecord [] => ((L'.EPrim (Prim.String ""), loc), fm) 220 | L'.TRecord [] => ((L'.EPrim (Prim.String ""), loc), fm)
221 | L'.TRecord ((x, t) :: xts) =>
222 let
223 val (se, fm) = fooify fm ((L'.EField (e, x), loc), t)
224 in
225 foldl (fn ((x, t), (se, fm)) =>
226 let
227 val (se', fm) = fooify fm ((L'.EField (e, x), loc), t)
228 in
229 ((L'.EStrcat (se,
230 (L'.EStrcat ((L'.EPrim (Prim.String "/"), loc),
231 se'), loc)), loc),
232 fm)
233 end) (se, fm) xts
234 end
220 235
221 | L'.TDatatype (i, ref (dk, _)) => 236 | L'.TDatatype (i, ref (dk, _)) =>
222 let 237 let
223 fun makeDecl n fm = 238 fun makeDecl n fm =
224 let 239 let