Open nventuro opened 4 years ago
(note that this only happens when verifying and not when compiling due to our new custom parser)
Maybe we can build a custom flattener based on our own parser...?
Alternatively we can change truffle-flattener to use our own parser, since it only uses the antlr one to extract the imports. It'd also be faster as a side effect :stuck_out_tongue:
@alcuadrado would you be open to this?
I can update it, but I'm not sure which parser you are talking about.
This is the one: https://github.com/frangio/fuzzy-import-parser
How is that parser generated? Have you tested it enough?
Maybe I can release an rc of truffle-flattener with it first
When verifying a contract with an incomplete Solidity version pragma, such as
pragma solidity ^0.5
, the CLI outputs the following error message:Changing the pragma to
pragma solidity ^0.5.0
fixes the issue.The underlying cause is this issue in the parser, which truffle-flattener relies on: https://github.com/federicobond/solidity-parser-antlr/issues/15.
I'm not sure how we can handle this other than fixing the bug in the parser, but in the meantime, hopefully this report will help others facing the same issue.