summaryrefslogtreecommitdiff
path: root/src/lacweb.grm
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-03-28 17:34:57 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-03-28 17:34:57 -0400
commite9b1040a1f27a07afc7b2bf33522b1058163bf2b (patch)
tree07693c3eaedb3b11fb52fdfa8bcf8cc7c8aaecf8 /src/lacweb.grm
parenta6d534b172ccb8eadc24e0e903b196085869800e (diff)
Fun with records
Diffstat (limited to 'src/lacweb.grm')
-rw-r--r--src/lacweb.grm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lacweb.grm b/src/lacweb.grm
index 9d7079e4..80b35510 100644
--- a/src/lacweb.grm
+++ b/src/lacweb.grm
@@ -62,6 +62,7 @@ val s = ErrorMsg.spanOf
| eexp of exp
| eapps of exp
| eterm of exp
+ | rexp of (con * exp) list
%verbose (* print summary of errors *)
%pos int (* positions *)
@@ -147,7 +148,13 @@ eexp : eapps (eapps)
| FN SYMBOL DARROW eexp (EAbs (SYMBOL, NONE, eexp), s (FNleft, eexpright))
| LPAREN eexp RPAREN DCOLON cexp (EAnnot (eexp, cexp), s (LPARENleft, cexpright))
+ | eterm DOT ident (EField (eterm, ident), s (etermleft, identright))
eterm : LPAREN eexp RPAREN (#1 eexp, s (LPARENleft, RPARENright))
| SYMBOL (EVar SYMBOL, s (SYMBOLleft, SYMBOLright))
+ | LBRACE rexp RBRACE (ERecord rexp, s (LBRACEleft, RBRACEright))
+
+rexp : ([])
+ | ident EQ eexp ([(ident, eexp)])
+ | ident EQ eexp COMMA rexp ((ident, eexp) :: rexp)