From f9a6da293f3ccc5744c01315ff9d14d7197ca6be Mon Sep 17 00:00:00 2001 From: wechman Date: Fri, 8 Jul 2022 13:17:40 +0200 Subject: [PATCH] Update solidity grammar parser --- docs/grammar/SolidityParser.g4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/grammar/SolidityParser.g4 b/docs/grammar/SolidityParser.g4 index 92718b975..3629a742d 100644 --- a/docs/grammar/SolidityParser.g4 +++ b/docs/grammar/SolidityParser.g4 @@ -311,11 +311,16 @@ errorDefinition: LParen (parameters+=errorParameter (Comma parameters+=errorParameter)*)? RParen Semicolon; +/** + * User type operators. + */ +userOp: Add | Sub | Mul | Div | Mod | BitAnd | BitOr | BitXor | BitNot | Equal | NotEqual | LessThan | GreaterThan | LessThanOrEqual | GreaterThanOrEqual; + /** * Using directive to bind 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 (As userOp)? | (LBrace identifierPath (As userOp)? (Comma identifierPath (As userOp)?)* 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.