diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-04-07 12:24:31 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-04-07 12:24:31 -0400 |
commit | e52d6c0bc6e2e911515d21c6acc1e311a8e30db9 (patch) | |
tree | b422a6ade536f96b318a9d9547f2f2c95562691a /src/cjrize.sml | |
parent | 69400f0524e8bcaa264eed203b8581992a4d1f7d (diff) |
UNIQUE constraints
Diffstat (limited to 'src/cjrize.sml')
-rw-r--r-- | src/cjrize.sml | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/cjrize.sml b/src/cjrize.sml index 5e4b647a..839c0c57 100644 --- a/src/cjrize.sml +++ b/src/cjrize.sml @@ -524,7 +524,7 @@ fun cifyDecl ((d, loc), sm) = (NONE, SOME (ek, "/" ^ s, n, ts, t, L'.ServerAndPullAndPush), sm) end - | L.DTable (s, xts) => + | L.DTable (s, xts, e) => let val (xts, sm) = ListUtil.foldlMap (fn ((x, t), sm) => let @@ -532,8 +532,18 @@ fun cifyDecl ((d, loc), sm) = in ((x, t), sm) end) sm xts + + fun flatten e = + case #1 e of + L.ERecord [] => [] + | L.ERecord [(x, (L.EPrim (Prim.String v), _), _)] => [(x, v)] + | L.EStrcat (e1, e2) => flatten e1 @ flatten e2 + | _ => (ErrorMsg.errorAt loc "Constraint has not been fully determined"; + Print.prefaces "Undetermined constraint" + [("e", MonoPrint.p_exp MonoEnv.empty e)]; + []) in - (SOME (L'.DTable (s, xts), loc), NONE, sm) + (SOME (L'.DTable (s, xts, flatten e), loc), NONE, sm) end | L.DSequence s => (SOME (L'.DSequence s, loc), NONE, sm) |