Merge pull request #1395 from ethereum/grammar

Properly define the pragma directive in the grammar
This commit is contained in:
chriseth 2016-11-25 16:58:30 +01:00 committed by GitHub
commit d7677826d4

View File

@ -1,7 +1,7 @@
SourceUnit = (PragmaDirective | ImportDirective | ContractDefinition)*
// Pragma actually parses anything up to the trailing ';' to be fully forward-compatible.
PragmaDirective = 'pragma' Identifier Expression ';'
PragmaDirective = 'pragma' Identifier ([^;]+) ';'
ImportDirective = 'import' StringLiteral ('as' Identifier)? ';'
| 'import' ('*' | Identifier) ('as' Identifier)? 'from' StringLiteral ';'