mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove ambiguity from EventDefinition. Fix SourceUnit
This commit is contained in:
parent
9f772cb9a1
commit
baaad627c4
@ -1,12 +1,12 @@
|
|||||||
SourceUnit = (ImportDirective ';')* ContractDefinition
|
SourceUnit = (ImportDirective | ContractDefinition)*
|
||||||
|
|
||||||
ContractDefinition = ( 'contract' | 'library' ) Identifier
|
ContractDefinition = ( 'contract' | 'library' ) Identifier
|
||||||
( 'is' InheritanceSpecifier (',' InheritanceSpecifier )* )?
|
( 'is' InheritanceSpecifier (',' InheritanceSpecifier )* )?
|
||||||
'{' ContractPart* '}'
|
'{' ContractPart* '}'
|
||||||
|
|
||||||
ImportDirective = 'import' StringLiteral ('as' Identifier)?
|
ImportDirective = 'import' StringLiteral ('as' Identifier)? ';'
|
||||||
| 'import' ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral
|
| 'import' ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral ';'
|
||||||
| 'import' '{' Identifier ('as' Identifier)? ( ',' Identifier ('as' Identifier)? )* '}' 'from' StringLiteral
|
| 'import' '{' Identifier ('as' Identifier)? ( ',' Identifier ('as' Identifier)? )* '}' 'from' StringLiteral ';'
|
||||||
|
|
||||||
ContractPart = StateVariableDeclaration | UsingForDeclaration
|
ContractPart = StateVariableDeclaration | UsingForDeclaration
|
||||||
| StructDefinition | ModifierDefinition | FunctionDefinition | EventDefinition | EnumDefinition
|
| StructDefinition | ModifierDefinition | FunctionDefinition | EventDefinition | EnumDefinition
|
||||||
@ -21,12 +21,12 @@ ModifierDefinition = 'modifier' Identifier ParameterList? Block
|
|||||||
FunctionDefinition = 'function' Identifier ParameterList
|
FunctionDefinition = 'function' Identifier ParameterList
|
||||||
( FunctionCall | Identifier | 'constant' | 'external' | 'public' | 'internal' | 'private' )*
|
( FunctionCall | Identifier | 'constant' | 'external' | 'public' | 'internal' | 'private' )*
|
||||||
( 'returns' ParameterList )? Block
|
( 'returns' ParameterList )? Block
|
||||||
EventDefinition = 'event' Identifier (ParameterList | IndexedTypeParameterList) 'anonymous'? ';'
|
EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';'
|
||||||
|
|
||||||
EnumValue = Identifier
|
EnumValue = Identifier
|
||||||
EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'
|
EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'
|
||||||
|
|
||||||
IndexedTypeParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')'
|
IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')'
|
||||||
ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')'
|
ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')'
|
||||||
|
|
||||||
// semantic restriction: mappings and structs (recursively) containing mappings
|
// semantic restriction: mappings and structs (recursively) containing mappings
|
||||||
@ -70,7 +70,7 @@ Expression =
|
|||||||
| Expression '||' Expression
|
| Expression '||' Expression
|
||||||
| Expression '?' Expression ':' Expression
|
| Expression '?' Expression ':' Expression
|
||||||
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
|
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
|
||||||
| Expression? (',' Expression)?
|
| Expression? (',' Expression)
|
||||||
| PrimaryExpression
|
| PrimaryExpression
|
||||||
|
|
||||||
PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | StringLiteral
|
PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | StringLiteral
|
||||||
@ -81,7 +81,7 @@ MemberAccess = Expression '.' Identifier
|
|||||||
IndexAccess = Expression '[' Expression? ']'
|
IndexAccess = Expression '[' Expression? ']'
|
||||||
|
|
||||||
BooleanLiteral = 'true' | 'false'
|
BooleanLiteral = 'true' | 'false'
|
||||||
NumberLiteral = '0x'? [0-9]+ NumberUnit?
|
NumberLiteral = '0x'? [0-9]+ (' ' NumberUnit)?
|
||||||
NumberUnit = 'wei' | 'szabo' | 'finney' | 'ether'
|
NumberUnit = 'wei' | 'szabo' | 'finney' | 'ether'
|
||||||
| 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years'
|
| 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years'
|
||||||
StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"'
|
StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"'
|
||||||
|
Loading…
Reference in New Issue
Block a user