From: Adam Chlipala Date: Sun, 11 Nov 2007 13:31:56 +0000 (+0000) Subject: Add 'begin..end' alternative to parentheses X-Git-Tag: release_2010-11-19~164 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/1dd06e3cd2f4e8b23c398ac65ad09eff9d1c5a02?hp=f19ba3232998ecde9c4fb818278444474f4fce66 Add 'begin..end' alternative to parentheses --- diff --git a/src/domtool.grm b/src/domtool.grm index 0cf5778..3bbc578 100644 --- a/src/domtool.grm +++ b/src/domtool.grm @@ -31,7 +31,7 @@ open Ast | ARROW | DARROW | LARROW | COLON | CARET | BANG | AND | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE - | EQ | COMMA | BSLASH | BSLASHBSLASH | SEMI | LET | IN | END + | EQ | COMMA | BSLASH | BSLASHBSLASH | SEMI | LET | IN | BEGIN | END | ROOT | EXTERN | TYPE | VAL | WITH | WHERE | CONTEXT @@ -132,6 +132,7 @@ apps : term (term) | apps term (EApp (apps, term), (appsleft, termright)) term : LPAREN exp RPAREN (exp) + | BEGIN exp END (exp) | INT (EInt INT, (INTleft, INTright)) | STRING (EString STRING, (STRINGleft, STRINGright)) | LBRACK elist RBRACK (EList elist, (LBRACKleft, RBRACKright)) diff --git a/src/domtool.lex b/src/domtool.lex index 80c06c7..99449ca 100644 --- a/src/domtool.lex +++ b/src/domtool.lex @@ -125,6 +125,7 @@ lineComment = #[^\n]*\n; "let" => (Tokens.LET (yypos, yypos + size yytext)); "in" => (Tokens.IN (yypos, yypos + size yytext)); + "begin" => (Tokens.BEGIN (yypos, yypos + size yytext)); "end" => (Tokens.END (yypos, yypos + size yytext)); "with" => (Tokens.WITH (yypos, yypos + size yytext)); "where" => (Tokens.WHERE (yypos, yypos + size yytext));