ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
137 stars 53 forks source link

Fix "this" Bug and Add Expression Parser #96

Closed mikeseese closed 6 years ago

mikeseese commented 6 years ago

I can separate this into 2 separate PRs if preferred.

The first issue is that this is used instead of module.exports which was giving me an error.

The second proposal is adding a separate parser that looks for expressions rather than contracts. It's essentially the same thing as the solidity parser, but built to look for expressions. This supports a debugger runtime I'm creating (see https://github.com/augurProject/augur-bounties#-bounty-2-portable-solidity-debugger for more details) to help with evaluating arbitrary solidity expressions.

If there's a better way to do this, I'm willing to implement it! Thanks!

cgewecke commented 6 years ago

@seesemichaelj This parser is deprecated and it's principal consumers have long ago forked and now maintain their own copies :) (Sorry). The most well-maintained version is Raghav Dua's solparse.

Also well worth checking out Federico Bond's wonderful ANTLR4 js parser.

mikeseese commented 6 years ago

@cgewecke :sweat_smile: haha no worries, thanks for the recommendations!