Properly define the pragma directive in the grammar

This commit is contained in:
Alex Beregszaszi 2016-11-18 03:15:24 +00:00
parent b46a14f4a8
commit 92f1c9d492

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 ';'