summaryrefslogtreecommitdiff
path: root/src/lacweb.grm
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-06-17 16:38:54 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-06-17 16:38:54 -0400
commitb9406323848c150f5a8562ad206916c446529d65 (patch)
tree5464b011b61ca366be29dabd74275245b60659b9 /src/lacweb.grm
parent4bb0bbc1920b5474619cb00e278590e029cdb12a (diff)
Elaborating module projection
Diffstat (limited to 'src/lacweb.grm')
-rw-r--r--src/lacweb.grm17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lacweb.grm b/src/lacweb.grm
index 0c708699..f8f54fca 100644
--- a/src/lacweb.grm
+++ b/src/lacweb.grm
@@ -60,6 +60,9 @@ val s = ErrorMsg.spanOf
| kind of kind
| kcolon of explicitness
+ | path of string list * string
+ | spath of str
+
| cexp of con
| capps of con
| cterm of con
@@ -126,7 +129,10 @@ sgis : ([])
| sgi sgis (sgi :: sgis)
str : STRUCT decls END (StrConst decls, s (STRUCTleft, ENDright))
- | CSYMBOL (StrVar CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
+ | spath (spath)
+
+spath : CSYMBOL (StrVar CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
+ | spath DOT CSYMBOL (StrProj (spath, CSYMBOL), s (spathleft, CSYMBOLright))
kind : TYPE (KType, s (TYPEleft, TYPEright))
| NAME (KName, s (NAMEleft, NAMEright))
@@ -153,6 +159,9 @@ cexp : capps (capps)
kcolon : DCOLON (Explicit)
| TCOLON (Implicit)
+path : SYMBOL ([], SYMBOL)
+ | CSYMBOL DOT path (let val (ms, x) = path in (CSYMBOL :: ms, x) end)
+
cterm : LPAREN cexp RPAREN (#1 cexp, s (LPARENleft, RPARENright))
| LBRACK rcon RBRACK (CRecord rcon, s (LBRACKleft, RBRACKright))
| LBRACE rcone RBRACE (TRecord (CRecord rcone, s (LBRACEleft, RBRACEright)),
@@ -160,7 +169,7 @@ cterm : LPAREN cexp RPAREN (#1 cexp, s (LPARENleft, RPARENright))
| DOLLAR cterm (TRecord cterm, s (DOLLARleft, ctermright))
| HASH CSYMBOL (CName CSYMBOL, s (HASHleft, CSYMBOLright))
- | SYMBOL (CVar SYMBOL, s (SYMBOLleft, SYMBOLright))
+ | path (CVar path, s (pathleft, pathright))
| UNDER (CWild (KWild, s (UNDERleft, UNDERright)), s (UNDERleft, UNDERright))
rcon : ([])
@@ -172,7 +181,7 @@ rcone : ([])
| ident COLON cexp COMMA rcone ((ident, cexp) :: rcone)
ident : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
- | SYMBOL (CVar SYMBOL, s (SYMBOLleft, SYMBOLright))
+ | SYMBOL (CVar ([], SYMBOL), s (SYMBOLleft, SYMBOLright))
eapps : eterm (eterm)
| eapps eterm (EApp (eapps, eterm), s (eappsleft, etermright))
@@ -188,7 +197,7 @@ eexp : eapps (eapps)
eterm : LPAREN eexp RPAREN (#1 eexp, s (LPARENleft, RPARENright))
- | SYMBOL (EVar SYMBOL, s (SYMBOLleft, SYMBOLright))
+ | path (EVar path, s (pathleft, pathright))
| LBRACE rexp RBRACE (ERecord rexp, s (LBRACEleft, RBRACEright))
| INT (EPrim (Prim.Int INT), s (INTleft, INTright))