fixup! Add errors to grammar.

This commit is contained in:
chriseth 2021-02-02 11:25:16 +01:00
parent 44a717cf2f
commit 8e8aa25523
2 changed files with 4 additions and 3 deletions

View File

@ -295,7 +295,7 @@ eventDefinition:
* Definition of an error. * Definition of an error.
*/ */
errorDefinition: errorDefinition:
'error' name=identifier Error name=identifier
LParen (parameters=parameterList)? RParen LParen (parameters=parameterList)? RParen
Semicolon; Semicolon;
@ -377,7 +377,7 @@ inlineArrayExpression: LBrack (expression ( Comma expression)* ) RBrack;
/** /**
* Besides regular non-keyword Identifiers, the 'from' keyword can also occur as identifier outside of import statements. * Besides regular non-keyword Identifiers, the 'from' keyword can also occur as identifier outside of import statements.
*/ */
identifier: Identifier | From; identifier: Identifier | From | Error;
literal: stringLiteral | numberLiteral | booleanLiteral | hexStringLiteral | unicodeStringLiteral; literal: stringLiteral | numberLiteral | booleanLiteral | hexStringLiteral | unicodeStringLiteral;
booleanLiteral: True | False; booleanLiteral: True | False;

View File

@ -29,12 +29,13 @@ Do: 'do';
Else: 'else'; Else: 'else';
Emit: 'emit'; Emit: 'emit';
Enum: 'enum'; Enum: 'enum';
Error: 'error'; // not a real keyword
Event: 'event'; Event: 'event';
External: 'external'; External: 'external';
Fallback: 'fallback'; Fallback: 'fallback';
False: 'false'; False: 'false';
Fixed: 'fixed' | ('fixed' [1-9][0-9]* 'x' [1-9][0-9]*); Fixed: 'fixed' | ('fixed' [1-9][0-9]* 'x' [1-9][0-9]*);
From: 'from'; From: 'from'; // not a real keyword
/** /**
* Bytes types of fixed length. * Bytes types of fixed length.
*/ */