Skip to content

Commit

Permalink
feat(grammar): update grammar to 0.8.19
Browse files Browse the repository at this point in the history
  • Loading branch information
RyuuGan committed Feb 24, 2023
1 parent b883426 commit 5708118
Show file tree
Hide file tree
Showing 8 changed files with 3,491 additions and 1,600 deletions.
22 changes: 21 additions & 1 deletion grammar/SolidityParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,31 @@ errorDefinition:
LParen (parameters+=errorParameter (Comma parameters+=errorParameter)*)? RParen
Semicolon;

/**
* Operators that users are allowed to implement for some types with `using for`.
*/
userDefinableOperator:
BitAnd
| BitNot
| BitOr
| BitXor
| Add
| Div
| Mod
| Mul
| Sub
| Equal
| GreaterThan
| GreaterThanOrEqual
| LessThan
| LessThanOrEqual
| NotEqual;

/**
* Using directive to attach library functions and free functions to types.
* Can occur within contracts and libraries and at the file level.
*/
usingDirective: Using (identifierPath | (LBrace identifierPath (Comma identifierPath)* RBrace)) For (Mul | typeName) Global? Semicolon;
usingDirective: Using (identifierPath | (LBrace identifierPath (As userDefinableOperator)? (Comma identifierPath (As userDefinableOperator)?)* RBrace)) For (Mul | typeName) Global? Semicolon;
/**
* A type name can be an elementary type, a function type, a mapping type, a user-defined type
* (e.g. a contract or struct) or an array type.
Expand Down
3 changes: 2 additions & 1 deletion lib/antlr/generated/SolidityParser.interp

Large diffs are not rendered by default.

Loading

0 comments on commit 5708118

Please sign in to comment.