comparison src/lacweb.grm @ 140:f214c535d253

A simpler context encoding
author Adam Chlipala <adamc@hcoop.net>
date Sun, 20 Jul 2008 10:40:25 -0400
parents 5df655503288
children 63c699450281
comparison
equal deleted inserted replaced
139:adfa2c7a75da 140:f214c535d253
308 308
309 xml : xmlOne xml (let 309 xml : xmlOne xml (let
310 val pos = s (xmlOneleft, xmlright) 310 val pos = s (xmlOneleft, xmlright)
311 in 311 in
312 (EApp ((EApp ( 312 (EApp ((EApp (
313 (ECApp ((EVar (["Basis"], "join"), pos), 313 (EVar (["Basis"], "join"), pos),
314 (CWild (KRecord (KUnit, pos), pos), pos)), pos),
315 xmlOne), pos), 314 xmlOne), pos),
316 xml), pos) 315 xml), pos)
317 end) 316 end)
318 | xmlOne (xmlOne) 317 | xmlOne (xmlOne)
319 318
320 xmlOne : NOTAGS (EApp ((EVar (["Basis"], "cdata"), s (NOTAGSleft, NOTAGSright)), 319 xmlOne : NOTAGS (EApp ((EVar (["Basis"], "cdata"), s (NOTAGSleft, NOTAGSright)),
321 (EPrim (Prim.String NOTAGS), s (NOTAGSleft, NOTAGSright))), 320 (EPrim (Prim.String NOTAGS), s (NOTAGSleft, NOTAGSright))),
323 | BEGIN_TAG attrs DIVIDE GT (let 322 | BEGIN_TAG attrs DIVIDE GT (let
324 val pos = s (BEGIN_TAGleft, GTright) 323 val pos = s (BEGIN_TAGleft, GTright)
325 in 324 in
326 (EApp ((EApp ((EApp ((EVar (["Basis"], "tag"), pos), 325 (EApp ((EApp ((EApp ((EVar (["Basis"], "tag"), pos),
327 (ERecord attrs, pos)), pos), 326 (ERecord attrs, pos)), pos),
328 (EVar ([], BEGIN_TAG), pos)), 327 ((EApp ((EVar ([], BEGIN_TAG), pos),
328 (ERecord [], pos)), pos))),
329 pos), 329 pos),
330 (EApp ((EVar (["Basis"], "cdata"), pos), 330 (EApp ((EVar (["Basis"], "cdata"), pos),
331 (EPrim (Prim.String ""), pos)), 331 (EPrim (Prim.String ""), pos)),
332 pos)), pos) 332 pos)), pos)
333 end) 333 end)
336 val pos = s (BEGIN_TAGleft, GTright) 336 val pos = s (BEGIN_TAGleft, GTright)
337 in 337 in
338 if BEGIN_TAG = END_TAG then 338 if BEGIN_TAG = END_TAG then
339 (EApp ((EApp ((EApp ((EVar (["Basis"], "tag"), pos), 339 (EApp ((EApp ((EApp ((EVar (["Basis"], "tag"), pos),
340 (ERecord attrs, pos)), pos), 340 (ERecord attrs, pos)), pos),
341 (EVar ([], BEGIN_TAG), pos)), 341 (EApp ((EVar ([], BEGIN_TAG), pos),
342 (ERecord [], pos)), pos)),
342 pos), 343 pos),
343 xml), pos) 344 xml), pos)
344 else 345 else
345 (ErrorMsg.errorAt pos "Begin and end tags don't match."; 346 (ErrorMsg.errorAt pos "Begin and end tags don't match.";
346 (EFold, pos)) 347 (EFold, pos))