comparison src/lacweb.grm @ 200:5dbba661deab

Urlifying records
author Adam Chlipala <adamc@hcoop.net>
date Sat, 09 Aug 2008 20:08:29 -0400
parents 890a61991263
children dd82457fda82
comparison
equal deleted inserted replaced
199:c938fe391c84 200:5dbba661deab
87 | cexp of con 87 | cexp of con
88 | capps of con 88 | capps of con
89 | cterm of con 89 | cterm of con
90 | ctuple of con list 90 | ctuple of con list
91 | ident of con 91 | ident of con
92 | idents of con list
92 | rcon of (con * con) list 93 | rcon of (con * con) list
93 | rconn of (con * con) list 94 | rconn of (con * con) list
94 | rcone of (con * con) list 95 | rcone of (con * con) list
95 96
96 | eexp of exp 97 | eexp of exp
322 | ident COLON cexp ([(ident, cexp)]) 323 | ident COLON cexp ([(ident, cexp)])
323 | ident COLON cexp COMMA rcone ((ident, cexp) :: rcone) 324 | ident COLON cexp COMMA rcone ((ident, cexp) :: rcone)
324 325
325 ident : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright)) 326 ident : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
326 | INT (CName (Int64.toString INT), s (INTleft, INTright)) 327 | INT (CName (Int64.toString INT), s (INTleft, INTright))
327 | path (CVar path, s (pathleft, pathright)) 328 | SYMBOL (CVar ([], SYMBOL), s (SYMBOLleft, SYMBOLright))
328 329
329 eapps : eterm (eterm) 330 eapps : eterm (eterm)
330 | eapps eterm (EApp (eapps, eterm), s (eappsleft, etermright)) 331 | eapps eterm (EApp (eapps, eterm), s (eappsleft, etermright))
331 | eapps LBRACK cexp RBRACK (ECApp (eapps, cexp), s (eappsleft, RBRACKright)) 332 | eapps LBRACK cexp RBRACK (ECApp (eapps, cexp), s (eappsleft, RBRACKright))
332 333
367 368
368 | INT (EPrim (Prim.Int INT), s (INTleft, INTright)) 369 | INT (EPrim (Prim.Int INT), s (INTleft, INTright))
369 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) 370 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright))
370 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) 371 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright))
371 372
372 | path DOT ident (EField ((EVar path, s (pathleft, pathright)), ident), s (pathleft, identright)) 373 | path DOT idents (let
374 val loc = s (pathleft, identsright)
375 in
376 foldl (fn (ident, e) =>
377 (EField (e, ident), loc))
378 (EVar path, s (pathleft, pathright)) idents
379 end)
373 | FOLD (EFold, s (FOLDleft, FOLDright)) 380 | FOLD (EFold, s (FOLDleft, FOLDright))
374 381
375 | XML_BEGIN xml XML_END (xml) 382 | XML_BEGIN xml XML_END (xml)
376 | XML_BEGIN XML_END (EApp ((EVar (["Basis"], "cdata"), s (XML_BEGINleft, XML_ENDright)), 383 | XML_BEGIN XML_END (EApp ((EVar (["Basis"], "cdata"), s (XML_BEGINleft, XML_ENDright)),
377 (EPrim (Prim.String ""), s (XML_BEGINleft, XML_ENDright))), 384 (EPrim (Prim.String ""), s (XML_BEGINleft, XML_ENDright))),
378 s (XML_BEGINleft, XML_ENDright)) 385 s (XML_BEGINleft, XML_ENDright))
386
387 idents : ident ([ident])
388 | ident DOT idents (ident :: idents)
379 389
380 etuple : eexp COMMA eexp ([eexp1, eexp2]) 390 etuple : eexp COMMA eexp ([eexp1, eexp2])
381 | eexp COMMA etuple (eexp :: etuple) 391 | eexp COMMA etuple (eexp :: etuple)
382 392
383 branch : pat DARROW eexp (pat, eexp) 393 branch : pat DARROW eexp (pat, eexp)