Mercurial > urweb
comparison src/cjrize.sml @ 2048:4d64af730e35
Differentiate between HTML and normal string literals
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 01 Aug 2014 15:44:17 -0400 |
parents | 98895243b5b6 |
children | a9159911c3ba |
comparison
equal
deleted
inserted
replaced
2047:6be31671911b | 2048:4d64af730e35 |
---|---|
240 | 240 |
241 fun cifyExp (eAll as (e, loc), sm) = | 241 fun cifyExp (eAll as (e, loc), sm) = |
242 let | 242 let |
243 fun fail msg = | 243 fun fail msg = |
244 (ErrorMsg.errorAt loc msg; | 244 (ErrorMsg.errorAt loc msg; |
245 ((L'.EPrim (Prim.String ""), loc), sm)) | 245 ((L'.EPrim (Prim.String (Prim.Normal, "")), loc), sm)) |
246 in | 246 in |
247 case e of | 247 case e of |
248 L.EPrim p => ((L'.EPrim p, loc), sm) | 248 L.EPrim p => ((L'.EPrim p, loc), sm) |
249 | L.ERel n => ((L'.ERel n, loc), sm) | 249 | L.ERel n => ((L'.ERel n, loc), sm) |
250 | L.ENamed n => ((L'.ENamed n, loc), sm) | 250 | L.ENamed n => ((L'.ENamed n, loc), sm) |
630 end) sm xts | 630 end) sm xts |
631 | 631 |
632 fun flatten e = | 632 fun flatten e = |
633 case #1 e of | 633 case #1 e of |
634 L.ERecord [] => [] | 634 L.ERecord [] => [] |
635 | L.ERecord [(x, (L.EPrim (Prim.String v), _), _)] => [(x, v)] | 635 | L.ERecord [(x, (L.EPrim (Prim.String (_, v)), _), _)] => [(x, v)] |
636 | L.EStrcat (e1, e2) => flatten e1 @ flatten e2 | 636 | L.EStrcat (e1, e2) => flatten e1 @ flatten e2 |
637 | _ => (ErrorMsg.errorAt loc "Constraint has not been fully determined"; | 637 | _ => (ErrorMsg.errorAt loc "Constraint has not been fully determined"; |
638 Print.prefaces "Undetermined constraint" | 638 Print.prefaces "Undetermined constraint" |
639 [("e", MonoPrint.p_exp MonoEnv.empty e)]; | 639 [("e", MonoPrint.p_exp MonoEnv.empty e)]; |
640 []) | 640 []) |
641 | 641 |
642 val pe = case #1 pe of | 642 val pe = case #1 pe of |
643 L.EPrim (Prim.String s) => s | 643 L.EPrim (Prim.String (_, s)) => s |
644 | _ => (ErrorMsg.errorAt loc "Primary key has not been fully determined"; | 644 | _ => (ErrorMsg.errorAt loc "Primary key has not been fully determined"; |
645 Print.prefaces "Undetermined constraint" | 645 Print.prefaces "Undetermined constraint" |
646 [("e", MonoPrint.p_exp MonoEnv.empty pe)]; | 646 [("e", MonoPrint.p_exp MonoEnv.empty pe)]; |
647 "") | 647 "") |
648 in | 648 in |
660 end) sm xts | 660 end) sm xts |
661 | 661 |
662 fun flatten e = | 662 fun flatten e = |
663 case #1 e of | 663 case #1 e of |
664 L.ERecord [] => [] | 664 L.ERecord [] => [] |
665 | L.ERecord [(x, (L.EPrim (Prim.String v), _), _)] => [(x, v)] | 665 | L.ERecord [(x, (L.EPrim (Prim.String (_, v)), _), _)] => [(x, v)] |
666 | L.EStrcat (e1, e2) => flatten e1 @ flatten e2 | 666 | L.EStrcat (e1, e2) => flatten e1 @ flatten e2 |
667 | _ => (ErrorMsg.errorAt loc "Constraint has not been fully determined"; | 667 | _ => (ErrorMsg.errorAt loc "Constraint has not been fully determined"; |
668 Print.prefaces "Undetermined constraint" | 668 Print.prefaces "Undetermined constraint" |
669 [("e", MonoPrint.p_exp MonoEnv.empty e)]; | 669 [("e", MonoPrint.p_exp MonoEnv.empty e)]; |
670 []) | 670 []) |
671 | 671 |
672 val e = case #1 e of | 672 val e = case #1 e of |
673 L.EPrim (Prim.String s) => s | 673 L.EPrim (Prim.String (_, s)) => s |
674 | _ => (ErrorMsg.errorAt loc "VIEW query has not been fully determined"; | 674 | _ => (ErrorMsg.errorAt loc "VIEW query has not been fully determined"; |
675 Print.prefaces "Undetermined VIEW query" | 675 Print.prefaces "Undetermined VIEW query" |
676 [("e", MonoPrint.p_exp MonoEnv.empty e)]; | 676 [("e", MonoPrint.p_exp MonoEnv.empty e)]; |
677 "") | 677 "") |
678 in | 678 in |