ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
137 stars 53 forks source link

Support multiple inheritance #1

Closed ckeenan closed 8 years ago

ckeenan commented 8 years ago

Single inheritance pattern works OK, but multiple will fail. Example:

contract A {}
contract B {}
contract C is A, B {} // Fails
contract D is A {} // Succeeds

AFAICT, this functionality is currently supported by sol compilers -- http://solidity.readthedocs.io/en/latest/contracts.html#inheritance

Here is the error message from truffle compile:

/usr/local/lib/node_modules/truffle/node_modules/solidity-parser/index.js:39
      throw e;
      ^
SyntaxError: Expected "(", "{", comment, end of line, identifier or whitespace but "," found. Line: 14, Column: 30
    at peg$buildException (/usr/local/lib/node_modules/truffle/node_modules/solidity-parser/build/imports_parser.js:423:14)
    at Object.peg$parse [as parse] (/usr/local/lib/node_modules/truffle/node_modules/solidity-parser/build/imports_parser.js:3257:13)
    at Object.module.exports.parse (/usr/local/lib/node_modules/truffle/node_modules/solidity-parser/index.js:34:23)
    at /usr/local/lib/node_modules/truffle/lib/profiler.js:120:36
    at tryToString (fs.js:414:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12)
tcoulter commented 8 years ago

This has been fixed in 0.0.9. Closing. Thanks!

thomsonimjd commented 6 years ago

could you please give proper ans to the issue?