changeset 89:d3ee072fa609

Tested constraints through functors
author Adam Chlipala <adamc@hcoop.net>
date Tue, 01 Jul 2008 16:06:58 -0400
parents 7bab29834cd6
children 94ef20a31550
files src/lacweb.grm tests/constraint.lac
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lacweb.grm	Tue Jul 01 15:58:02 2008 -0400
+++ b/src/lacweb.grm	Tue Jul 01 16:06:58 2008 -0400
@@ -242,7 +242,7 @@
        | ident COLON cexp COMMA rcone   ((ident, cexp) :: rcone)
 
 ident  : CSYMBOL                        (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
-       | SYMBOL                         (CVar ([], SYMBOL), s (SYMBOLleft, SYMBOLright))
+       | path                           (CVar path, s (pathleft, pathright))
 
 eapps  : eterm                          (eterm)
        | eapps eterm                    (EApp (eapps, eterm), s (eappsleft, etermright))
--- a/tests/constraint.lac	Tue Jul 01 15:58:02 2008 -0400
+++ b/tests/constraint.lac	Tue Jul 01 16:06:58 2008 -0400
@@ -27,3 +27,19 @@
         con r' = M.r
         con combo = [nm' = int] ++ r'
 end
+
+
+signature S' = sig
+        con r1 :: {Type}
+        con r2 :: {Type}
+
+        constraint r1 ~ r2
+end
+
+functor F (M : S) : S' = struct
+        con r1 = [M.nm = int]
+        con r2 = M.r
+
+        open constraints M
+        constraint r1 ~ r2
+end