diff --git a/docs/core-grammar.md b/docs/core-grammar.md index a961fd026..a353af7bf 100644 --- a/docs/core-grammar.md +++ b/docs/core-grammar.md @@ -3,28 +3,28 @@ This is an EBNF grammar for the (experimental) core IR language. ``` - expr ::= expr '.' expr - | expr ' '+ expr - | '{' expr (';' expr)* ';'? '}' - | 'if' expr 'then' expr 'else' expr - | ('lexical' | 'import' | 'load') expr - | lit - | 'let'? lvalue '=' expr - | '(' expr ')' +expr ::= expr '.' expr + | expr ' '+ expr + | '{' expr (';' expr)* ';'? '}' + | 'if' expr 'then' expr 'else' expr + | ('lexical' | 'import' | 'load') expr + | lit + | 'let'? lvalue '=' expr + | '(' expr ')' - lvalue ::= ident - | parens expr +lvalue ::= ident + | parens expr - lit ::= '#true' - | '#false' - | 'unit' - | 'frame' - | lambda - | ident +lit ::= '#true' + | '#false' + | 'unit' + | 'frame' + | lambda + | ident - lambda ::= ('λ' | '\') ident ('->' | '→') expr +lambda ::= ('λ' | '\') ident ('->' | '→') expr - ident ::= [A-z_] ([A-z0-9_])* - | '#{' [^{}]+ '}' - | '"' [^"]+ '"' - ``` +ident ::= [A-z_] ([A-z0-9_])* + | '#{' [^{}]+ '}' + | '"' [^"]+ '"' +```