Skip to content

Commit

Permalink
Grammar for revert statement.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Mar 16, 2021
1 parent 9ccfd87 commit 65172ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/grammar/Solidity.g4
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ inlineArrayExpression: LBrack (expression ( Comma expression)* ) RBrack;
/**
* Besides regular non-keyword Identifiers, the 'from' keyword can also occur as identifier outside of import statements.
*/
identifier: Identifier | From | Error;
identifier: Identifier | From | Error | Revert;

literal: stringLiteral | numberLiteral | booleanLiteral | hexStringLiteral | unicodeStringLiteral;
booleanLiteral: True | False;
Expand Down Expand Up @@ -422,6 +422,7 @@ statement:
| tryStatement
| returnStatement
| emitStatement
| revertStatement
| assemblyStatement
;

Expand Down Expand Up @@ -459,6 +460,10 @@ returnStatement: Return expression? Semicolon;
* An emit statement. The contained expression needs to refer to an event.
*/
emitStatement: Emit expression callArgumentList Semicolon;
/**
* A revert statement. The contained expression needs to refer to an error.
*/
revertStatement: Revert expression callArgumentList Semicolon;
/**
* An inline assembly block.
* The contents of an inline assembly block use a separate scanner/lexer, i.e. the set of keywords and
Expand Down
1 change: 1 addition & 0 deletions docs/grammar/SolidityLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Else: 'else';
Emit: 'emit';
Enum: 'enum';
Error: 'error'; // not a real keyword
Revert: 'revert'; // not a real keyword
Event: 'event';
External: 'external';
Fallback: 'fallback';
Expand Down

0 comments on commit 65172ed

Please sign in to comment.