Skip to content

Commit b2b01ae

Browse files
committed
Updated ANTLR grammar to include user defined value types.
1 parent 2fbcc13 commit b2b01ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/grammar/SolidityParser.g4

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ sourceUnit: (
1919
| constantVariableDeclaration
2020
| structDefinition
2121
| enumDefinition
22+
| userDefinedValueTypeDefinition
2223
| errorDefinition
2324
)* EOF;
2425

@@ -89,6 +90,7 @@ contractBodyElement:
8990
| receiveFunctionDefinition
9091
| structDefinition
9192
| enumDefinition
93+
| userDefinedValueTypeDefinition
9294
| stateVariableDeclaration
9395
| eventDefinition
9496
| errorDefinition
@@ -247,6 +249,11 @@ structMember: type=typeName name=identifier Semicolon;
247249
* Definition of an enum. Can occur at top-level within a source unit or within a contract, library or interface.
248250
*/
249251
enumDefinition: Enum name=identifier LBrace enumValues+=identifier (Comma enumValues+=identifier)* RBrace;
252+
/**
253+
* Definition of a user defined value type. Can occur at top-level within a source unit or within a contract, library or interface.
254+
*/
255+
userDefinedValueTypeDefinition:
256+
Type name=identifier Is elementaryTypeName[true] Semicolon;
250257

251258
/**
252259
* The declaration of a state variable.

0 commit comments

Comments
 (0)