ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
137 stars 53 forks source link

new `pragma experimental` grammar yields SyntaxError #93

Closed isaackwan closed 6 years ago

isaackwan commented 6 years ago

Hello -

Just a quick note that the new pragma experimental grammar yields exceptions in the parser.

Example output:

isaac@localhost:~/Development/truffle$ ~/Programs/truffle/node_modules/truffle-core/cli.js test
SyntaxError: Error parsing /home/isaac/Development/truffle/contracts/Registry.sol: Expected "solidity", comment, end of line, or whitespace but "e" found. Line: 3, Column: 8
    at peg$buildStructuredError (/home/isaac/Programs/truffle/node_modules/solidity-parser/build/imports_parser.js:543:12)
    at Object.peg$parse [as parse] (/home/isaac/Programs/truffle/node_modules/solidity-parser/build/imports_parser.js:4142:11)
    at Object.parse (/home/isaac/Programs/truffle/node_modules/solidity-parser/index.js:34:23)
    at /home/isaac/Programs/truffle/node_modules/truffle-compile/profiler.js:200:36
    at /home/isaac/Programs/truffle/node_modules/truffle-resolver/index.js:79:5
    at /home/isaac/Programs/truffle/node_modules/async/internal/onlyOnce.js:12:16
    at next (/home/isaac/Programs/truffle/node_modules/async/whilst.js:68:18)
    at /home/isaac/Programs/truffle/node_modules/truffle-resolver/index.js:64:7
    at /home/isaac/Programs/truffle/node_modules/truffle-resolver/fs.js:65:5
    at /home/isaac/Programs/truffle/node_modules/async/internal/once.js:12:16

Example script:

pragma experimental SMTChecker;

contract Demo {}

I realize that this report is somewhat brief description (and that solidity-parser is to be transferred to the truffle organisation) -- will update this issue report once I've got time. Thanks for the amazing work!

Isaac

federicobond commented 6 years ago

@isaackwan thanks for the report. This library is not maintained anymore. I suggest you move to solidity-parser-antlr