parser2: add function call arguments

This commit is contained in:
darkf 2013-11-01 19:17:09 -07:00
parent e9f4be39f8
commit 97cadac9aa
1 changed files with 7 additions and 1 deletions

View File

@ -12,8 +12,14 @@ statements :: [AST]
statement :: AST
= expr "."
args :: AST
= expr ("," expr)+ { TupleConst ($1 : $2) }
/ expr? { case $1 of
Just x -> x
Nothing -> UnitConst }
expr :: AST
= expr "(" ")" { Call $1 UnitConst }
= expr "(" args ")" { Call $1 $2 }
/ expr "+" fact { Add $1 $2 }
/ expr "-" fact { Sub $1 $2 }
/ fact