diff --git a/grammar.txt b/grammar.txt index ac928fd..50292be 100644 --- a/grammar.txt +++ b/grammar.txt @@ -28,10 +28,10 @@ control -> if -> "if" expression "then" expression "else" expression ; when -> "when" expression "is" ( ( identifier | pattern ) "=>" expression )+ ; variant -> "`" identifier ( "(" expression ")" )? ; -base_record -> expression ( "with" identifier "=" expression ( "," "with" identifier "=" expression )* )? +base_record -> expression ( "with" identifier "=" expression ( "," identifier "=" expression )* ","? )? record -> - "{" ( identifier ("=" expression)? ( "," identifier ("=" expression)? )* )? ( "|" base_record )* "}" ; -list -> "[" ( expression ( "," expression )* )? "]" ; + "{" ( identifier ("=" expression)? ( "," identifier ("=" expression)? )* )? ( "|" base_record )? "}" ; +list -> "[" ( expression ( "," expression )* ","? )? "]" ; identifier -> IDENTIFIER | "@" STRING ; operand -> ( NUMBER | STRING | identifier | "(" expression ")" | record | variant | list) ; selector -> "." identifier ;