mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
grammar.txt: Fixes to EnumDef and ArrayTypeName
This commit is contained in:
parent
c396148fe6
commit
ce8a003611
@ -13,14 +13,14 @@ FunctionDefinition = 'function' Identifier ParameterList
|
||||
( 'returns' ParameterList )? Block
|
||||
|
||||
EnumValue = Identifier
|
||||
EnumDefinition = 'enum' '{' EnumValue (',' EnumValue)* '}'
|
||||
EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'
|
||||
ParameterList = '(' ( VariableDeclaration (',' VariableDeclaration)* )? ')'
|
||||
// semantic restriction: mappings and structs (recursively) containing mappings
|
||||
// are not allowed in argument lists
|
||||
VariableDeclaration = TypeName Identifier
|
||||
TypeName = ElementaryTypeName | Identifier | Mapping | ArrayTypeName
|
||||
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
|
||||
ArrayTypeName = TypeName '[' (Expression)? ']'
|
||||
ArrayTypeName = TypeName ('[' Expression? ']')+
|
||||
|
||||
Block = '{' Statement* '}'
|
||||
Statement = IfStatement | WhileStatement | Block |
|
||||
|
Loading…
Reference in New Issue
Block a user