Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

solparse

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solparse

PEG.js Solidity parser for Javascript

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5K
decreased by-0.87%
Maintainers
1
Weekly downloads
 
Created
Source

solparse

Parse Solidity Code into Spider Monkey API compliant AST

#UPDATE All changes have now been merged into solidity-parser (thanks to axic and tcoulter). I'll continue to maintain this repo until all reported issues have been fixed and once those changes are merged into solidity-parser, this repo's maintenance will be discontinued. (And solidity-parser shall be flawless by then ;) )

This is a (much more) refined version of solidity-parser. I've fixed a lot of bugs (see below) and added features as per solidity grammar spec (but obviously its not perfect a.t.m.). I plan to maintain it long-term =)

#List of bugs in solidity-parser (as of this writing)

  1. No 'name' field in StructDeclaration - this means we never get to know the name of the struct from the StructDeclaration Node object. (I made a PR for this but no response even after 2 weeks :()

  2. IsStatement malfunctioning - When using inheritance with Contract or Library, the syntax is:

contract Car is Vehicle, Engine {
        //definition
}

Solidity parser doesn't parse the 'is' section properly. the is Array's first object is fine (vehicle), but subsequent element is just a comma, not another object for Engine.

  1. Exponentiation operator (double asterisk) not being parsed by solidity parser

  2. A statement like uint x = 2 days; doesn't get parsed. It gives error at start of 'days'. (though SP parses the other tokens: "2 wei / 2 szabo / 2 finny, etc.", "days" is a valid suffix too but doesn't have support.

  3. Parse of var (x) = 100; failing because x is surrounded by brackets (which is legal in solidity).

All these bugs have been fixed in solparse! If you find a bug or a missing feature in this parser, please open up an issue :)

FAQs

Package last updated on 27 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc