diff options
| author | Baitinq <[email protected]> | 2025-03-23 01:21:49 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-03-23 01:21:49 +0100 |
| commit | fe47528e65e4690a5600154978515cc29133e5da (patch) | |
| tree | fa25e6a8601d2c0ebf950e80a98c8dccc67857fb /grammar.ebnf | |
| parent | Misc: Fix building on linux (diff) | |
| download | pry-lang-fe47528e65e4690a5600154978515cc29133e5da.tar.gz pry-lang-fe47528e65e4690a5600154978515cc29133e5da.tar.bz2 pry-lang-fe47528e65e4690a5600154978515cc29133e5da.zip | |
Parser: Fix ambiguity with symbol declaration
Diffstat (limited to 'grammar.ebnf')
| -rw-r--r-- | grammar.ebnf | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/grammar.ebnf b/grammar.ebnf index 562f2f8..cbc3f0a 100644 --- a/grammar.ebnf +++ b/grammar.ebnf @@ -1,8 +1,10 @@ Program ::= Statement+ -Statement ::= (AssignmentStatement | FunctionCallStatement | IfStatement | WhileStatement | ReturnStatement) SEMICOLON +Statement ::= (AssignmentStatement | ExternDeclaration | FunctionCallStatement | IfStatement | WhileStatement | ReturnStatement) SEMICOLON -AssignmentStatement ::= "let" IDENTIFIER EQUALS (Type | Expression) +AssignmentStatement ::= "let"? IDENTIFIER EQUALS Expression + +ExternDeclaration ::= "extern" IDENTIFIER EQUALS Type FunctionCallStatement ::= (IDENTIFIER | FunctionDefinition) LPAREN FunctionArguments? RPAREN |