Due to some recent talks in the last EthCC let's have the ANTLR4 grammar definition for Solidity language in the main repository.
Other projects that need the grammar definition can "simply" copy'n'paste the that file into their own projects and use it.
@juanfranblanco
Since https://github.com/ConsenSys/solidity-antlr4/blob/master/Solidity.g4 was merged into the repo in March, @GNSPS, would it make sense adding a large deprecation notice to https://github.com/ConsenSys/solidity-antlr4 and potentially setting the repo to archive?
And @federicobond what do you think about doing the same with https://github.com/solidityj/solidity-antlr4 ?
LGTM, nice to see this integrated upstream!
馃檶 Will do! Thank you, @axic! 馃槉
Question, will it be possible to have a grammar published in solc-bin (or is it the plan?) for each version of solidity released? This way tooling can load specific grammar associated with the current solidity version. @axic
The current grammar is very lax and also matches older versions on purpose. Would you prefer a stricter, version-specific grammar?
@chriseth I see your point and I guess to start with might be the best approach, but looking at the issues that prettier solidity and solhint have been having with specific rules (override, etc) with new / old releases, or just simple autocomplete (key words), refactoring etc. It might be good to have different grammars in the future, which ideally can be loaded on the fly depending of the compiler version and features supported.
My guess is that in the future more keywords and syntax changes will be added, this way remain backwards compatible, rather than removed (extra features), so being a devil advocate of that thought, it might be just a question to understand what subset is added in each version release, to enable disable those elements.
@GNSPS thanks for updating ConsenSys/solidity-antlr4, but the deprecation notice seems to be recursive? :)
馃槀 I'm so sorry, Alex! Corrected!
Most helpful comment
Since https://github.com/ConsenSys/solidity-antlr4/blob/master/Solidity.g4 was merged into the repo in March, @GNSPS, would it make sense adding a large deprecation notice to https://github.com/ConsenSys/solidity-antlr4 and potentially setting the repo to archive?
And @federicobond what do you think about doing the same with https://github.com/solidityj/solidity-antlr4 ?