Finished specifying record grammar
This commit is contained in:
parent
c0767bc386
commit
e508d06b1a
@ -8,10 +8,9 @@ expression ->
|
||||
| control
|
||||
| field
|
||||
| index
|
||||
// | identifier
|
||||
| identifier
|
||||
| primary
|
||||
|
||||
identifier -> IDENTIFIER | "@" STRING ;
|
||||
grouping -> "(" expression ")" ;
|
||||
unary -> ( "-" | "!" ) expression ;
|
||||
binary -> expression operator expression ;
|
||||
@ -26,9 +25,11 @@ control ->
|
||||
if -> "if" expression "then" expression "else" expression ;
|
||||
compound -> variant | record | list ;
|
||||
variant -> "`" identifier ( "(" ( expression ( "," expression)* )? ")" )? ;
|
||||
base_record -> expression ( "with" identifier "=" expression ( "," "with" identifier "=" expression )* )?
|
||||
record ->
|
||||
"{" ( identifier "=" expression ( "," identifier "=" expression )* )? "}" ;
|
||||
"{" ( identifier ("=" expression)? ( "," identifier ("=" expression)? )* )? ( "|" base_record )* "}" ;
|
||||
list -> "[" ( expression ( "," expression )* )? "]" ;
|
||||
field -> expression "." identifier ;
|
||||
index -> expression "[" expression "]" ;
|
||||
primary -> NUMBER | STRING | "(" expression ")" ;
|
||||
identifier -> IDENTIFIER | "@" STRING ;
|
||||
primary -> NUMBER | STRING | identifier | "(" expression ")" ;
|
||||
|
Loading…
Reference in New Issue
Block a user