federicobond / solidity-parser-antlr

A Solidity parser for JS built on top of a robust ANTLR4 grammar
MIT License
155 stars 55 forks source link

Parse fails for 0.4.23 contracts #19

Closed elenadimitrova closed 6 years ago

elenadimitrova commented 6 years ago

After upgrading contracts to solc 0.4.23 parsing them fails with:

/node_modules/solidity-parser-antlr/src/index.js:53
    throw new ParserError({ errors: listener.getErrors() })
    ^
Error
    at new ParserError (/Users/Elena/colonyNetwork/node_modules/solidity-parser-antlr/src/index.js:12:16)
    at Object.parse (/Users/Elena/colonyNetwork/node_modules/solidity-parser-antlr/src/index.js:53:11)
    at /Users/Elena/colonyNetwork/scripts/check-storage.js:23:25
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/Elena/colonyNetwork/scripts/check-storage.js:5:32)
    at Module._compile (module.js:641:30)
    at loader (/Users/Elena/colonyNetwork/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/Elena/colonyNetwork/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)

Suspecting the culprit is the newly introduced constructor keyword.

federicobond commented 6 years ago

Thanks for reporting @elenadimitrova! Can you try the latest version published?

elenadimitrova commented 6 years ago

Confirmed as fixed in 0.2.10. Thanks for the quick turnaround on solving this!