Update grammar to represent optionality in catch clauses parameter list

This commit is contained in:
Gonçalo Sá 2020-01-09 23:12:24 +00:00
parent 24bf11a2bb
commit 57fcab80fc

View File

@ -72,7 +72,7 @@ Statement = IfStatement | TryStatement | WhileStatement | ForStatement | Block |
ExpressionStatement = Expression
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
TryStatement = 'try' Expression ( 'returns' ParameterList )? Block CatchClause+
CatchClause = 'catch' Identifier? ParameterList Block
CatchClause = 'catch' ( Identifier? ParameterList )? Block
WhileStatement = 'while' '(' Expression ')' Statement
PlaceholderStatement = '_'
SimpleStatement = VariableDefinition | ExpressionStatement