aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/grammar.txt11
1 files changed, 6 insertions, 5 deletions
diff --git a/libsolidity/grammar.txt b/libsolidity/grammar.txt
index 9678d538..23022676 100644
--- a/libsolidity/grammar.txt
+++ b/libsolidity/grammar.txt
@@ -1,11 +1,12 @@
-ContractDefinition = ('import' Imports ';')*
- ( 'contract' | 'library' ) Identifier
+SourceUnit = (ImportDirective ';')* ContractDefinition
+
+ContractDefinition = ( 'contract' | 'library' ) Identifier
( 'is' InheritanceSpecifier (',' InheritanceSpecifier )* )?
'{' ContractPart* '}'
-Imports = StringLiteral ('as' Identifier)?
- | ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral
- | '{' Identifier ('as' Identifier)? ( ',' Identifier ('as' Identifier)? )* '}' 'from' StringLiteral
+ImportDirective = 'import' StringLiteral ('as' Identifier)?
+ | 'import' ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral
+ | 'import' '{' Identifier ('as' Identifier)? ( ',' Identifier ('as' Identifier)? )* '}' 'from' StringLiteral
ContractPart = StateVariableDecOrDef | UsingDeclaration
| StructDefinition | ModifierDefinition | FunctionDefinition | EventDefinition | EnumDefinition