Skip to content

Commit

Permalink
Merge pull request #14788 from jeasonstudio/grammar-provide-using-ali…
Browse files Browse the repository at this point in the history
…ases

solidity grammar: add a new rule `usingAliases` for `usingDirective`
  • Loading branch information
ekpyron authored Feb 5, 2024
2 parents 3ed82c6 + a3e5f3f commit 1183284
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/grammar/SolidityParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,14 @@ userDefinableOperator:
* 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 (As userDefinableOperator)? (Comma identifierPath (As userDefinableOperator)?)* RBrace)) For (Mul | typeName) Global? Semicolon;
usingDirective:
Using (
identifierPath
| (LBrace usingAliases (Comma usingAliases)* RBrace)
) For (Mul | typeName) Global? Semicolon;

usingAliases: identifierPath (As userDefinableOperator)?;

/**
* 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

0 comments on commit 1183284

Please sign in to comment.