Allow trailing comma in list and record grammars
This commit is contained in:
parent
63edbae650
commit
5f9b4a2fb6
@ -28,10 +28,10 @@ control ->
|
|||||||
if -> "if" expression "then" expression "else" expression ;
|
if -> "if" expression "then" expression "else" expression ;
|
||||||
when -> "when" expression "is" ( ( identifier | pattern ) "=>" expression )+ ;
|
when -> "when" expression "is" ( ( identifier | pattern ) "=>" expression )+ ;
|
||||||
variant -> "`" identifier ( "(" expression ")" )? ;
|
variant -> "`" identifier ( "(" expression ")" )? ;
|
||||||
base_record -> expression ( "with" identifier "=" expression ( "," "with" identifier "=" expression )* )?
|
base_record -> expression ( "with" identifier "=" expression ( "," identifier "=" expression )* ","? )?
|
||||||
record ->
|
record ->
|
||||||
"{" ( identifier ("=" expression)? ( "," identifier ("=" expression)? )* )? ( "|" base_record )* "}" ;
|
"{" ( identifier ("=" expression)? ( "," identifier ("=" expression)? )* )? ( "|" base_record )? "}" ;
|
||||||
list -> "[" ( expression ( "," expression )* )? "]" ;
|
list -> "[" ( expression ( "," expression )* ","? )? "]" ;
|
||||||
identifier -> IDENTIFIER | "@" STRING ;
|
identifier -> IDENTIFIER | "@" STRING ;
|
||||||
operand -> ( NUMBER | STRING | identifier | "(" expression ")" | record | variant | list) ;
|
operand -> ( NUMBER | STRING | identifier | "(" expression ")" | record | variant | list) ;
|
||||||
selector -> "." identifier ;
|
selector -> "." identifier ;
|
||||||
|
Loading…
Reference in New Issue
Block a user