fix escapes in literal strings
[cc1516.git] / grammar / grammar.txt
index 78e5450..4325c92 100644 (file)
@@ -1,6 +1,7 @@
 <Prog>         ::= <FunDecl>+
 <FunDecl>      ::= <id> '(' <Type>* ')' ['::' <FunType] '{' <VarDecl>* <Stmt>+ '}'
 <FunType>      ::= <VoidType> ['->' <FunType>]
+                 | '(' <FunType> ')'
 <Stmt>         ::= 'if' '(' <Expr> ')' '{' <Stmt>* '}' ['else' '{' <Stmt>* '}']
                  | 'while' '(' <Expr> ')' '{' <Stmt>* '}'
                  | <id> <FieldSels> '=' <Expr> ';'
@@ -22,6 +23,7 @@
                  | <FunCall> <FieldSels>
                  | '[]' <Expr>
                  | '(' <Expr> ',' <Expr> ')'
+                 | '"' <char> '"'
 <FieldSels>    ::= ('.' ('hd'|'tl'|'fst'|'snd))*
 <FunCall>      ::= <id> ['(' <ActArgs>+ ')']
 <ActArgs>      ::= <Expr> [',' ActArgs]