diff --git a/grammar.txt b/grammar.txt index 17e22b9..ac928fd 100644 --- a/grammar.txt +++ b/grammar.txt @@ -4,7 +4,6 @@ expression -> | unary | binary | let - | compound | control | selector | index @@ -28,14 +27,13 @@ control -> | when if -> "if" expression "then" expression "else" expression ; when -> "when" expression "is" ( ( identifier | pattern ) "=>" expression )+ ; -compound -> variant | record | list ; variant -> "`" identifier ( "(" expression ")" )? ; base_record -> expression ( "with" identifier "=" expression ( "," "with" identifier "=" expression )* )? record -> "{" ( identifier ("=" expression)? ( "," identifier ("=" expression)? )* )? ( "|" base_record )* "}" ; list -> "[" ( expression ( "," expression )* )? "]" ; identifier -> IDENTIFIER | "@" STRING ; -operand -> ( NUMBER | STRING | identifier | "(" expression ")" ) ; +operand -> ( NUMBER | STRING | identifier | "(" expression ")" | record | variant | list) ; selector -> "." identifier ; index -> "[" expression "]" ; arguments -> "(" ( "_" | expression ( "," ( "_" | expression ) )* )? ")" ;