Added when expressions to grammar
This commit is contained in:
parent
e508d06b1a
commit
138508732f
@ -21,8 +21,10 @@ operator ->
|
|||||||
| "++" ;
|
| "++" ;
|
||||||
control ->
|
control ->
|
||||||
| if
|
| if
|
||||||
// | when
|
| when
|
||||||
if -> "if" expression "then" expression "else" expression ;
|
if -> "if" expression "then" expression "else" expression ;
|
||||||
|
variant_pattern -> "`" identifier ( "(" ( ( "_" | identifier ) ( "," ( "_" | identifier )* )? ) ")" )? ;
|
||||||
|
when -> "when" expression "is" ( variant_pattern "=>" expression )+ ;
|
||||||
compound -> variant | record | list ;
|
compound -> variant | record | list ;
|
||||||
variant -> "`" identifier ( "(" ( expression ( "," expression)* )? ")" )? ;
|
variant -> "`" identifier ( "(" ( expression ( "," expression)* )? ")" )? ;
|
||||||
base_record -> expression ( "with" identifier "=" expression ( "," "with" identifier "=" expression )* )?
|
base_record -> expression ( "with" identifier "=" expression ( "," "with" identifier "=" expression )* )?
|
||||||
|
Loading…
Reference in New Issue
Block a user