Closed federicobond closed 8 years ago
I'm not that experienced with PegJs so don't mind my being naive, but wouldn't this become significantly more complex? To specify which nodes are allowed inside for every node?
It shouldn't be difficult, just a matter of separating that big statement list into two rules.
Right now, the grammar allows pragma directives, imports and contracts to be declared inside the contract. These should trigger a syntax error:
The
solc
compiler grammar singles these out in theSourceUnit
rule. See here.