parser: calls bind less tightly; parse record access syntax (operator '\')
This commit is contained in:
parent
1d57fca6b4
commit
8ce39fa0e7
10
Parser.hs
10
Parser.hs
|
@ -75,7 +75,8 @@ ifcond :: AST
|
|||
= "if" expr "then" expr "else" expr { IfExpr $1 $2 $3 }
|
||||
|
||||
expr :: AST
|
||||
= expr "::" expr { Cons $1 $2 }
|
||||
= expr "(" args ")" { Call $1 $2 }
|
||||
/ expr "::" expr { Cons $1 $2 }
|
||||
/ expr "+" fact { Add $1 $2 }
|
||||
/ expr "-" fact { Sub $1 $2 }
|
||||
/ expr "==" fact { Equals $1 $2 }
|
||||
|
@ -90,11 +91,14 @@ expr :: AST
|
|||
fact :: AST
|
||||
= fact "*" term { Mul $1 $2 }
|
||||
/ fact "/" term { Div $1 $2 }
|
||||
/ access
|
||||
|
||||
access :: AST
|
||||
= access "\\" identifier { Access $1 (Var $2) }
|
||||
/ term
|
||||
|
||||
term :: AST
|
||||
= term "(" args ")" { Call $1 $2 }
|
||||
/ tuple
|
||||
= tuple
|
||||
/ "(" expr ")"
|
||||
/ "[" listseq "]"
|
||||
/ ifcond
|
||||
|
|
Loading…
Reference in New Issue