Comments (4)
Thanks for reporting! I'm just as excited as you to be able run this on full contracts (like the DAO). It is failing silently because the parser is just missing certain constructs that are being used in complex, real-world constructs that are not used in my simple test contracts. The next step would be to test this on slightly larger contracts, one-step-at-a-time, to identify which specific Solidity constructs are being missed by the parser.
My idea is to run it on a sampling of contracts from dapp-bin. That should give us a good representation of different Solidity contracts.
If you'd like to help, it would be awesome if you could find a small-ish contract that breaks solgraph and isolate what construct is different that it does not support. Then we can add the necessary unit test and implementation to get it to work.
from solgraph.
First of all: good work! :)
But I am having similar problems as @Bunjin with large contracts. I get the following parse error
Parse error
{ [SyntaxError: Expected "!=", "!==", "%", "%=", "&", "&&", "&=", "*", "*=", "+", "++", "+=", ",", "-", "--", "-=", "/", "/*", "//", "/=", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "^", "^=", "in", "instanceof", "|", "|=", "||", comment, end of line or whitespace but "f" found. Line: 26, Column: 21]
message: 'Expected "!=", "!==", "%", "%=", "&", "&&", "&=", "*", "*=", "+", "++", "+=", ",", "-", "--", "-=", "/", "/*", "//", "/=", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "^", "^=", "in", "instanceof", "|", "|=", "||", comment, end of line or whitespace but "f" found. Line: 26, Column: 21',
expected:
[ { type: 'literal', value: '!=', description: '"!="' },
{ type: 'literal', value: '!==', description: '"!=="' },
{ type: 'literal', value: '%', description: '"%"' },
{ type: 'literal', value: '%=', description: '"%="' },
{ type: 'literal', value: '&', description: '"&"' },
{ type: 'literal', value: '&&', description: '"&&"' },
{ type: 'literal', value: '&=', description: '"&="' },
{ type: 'literal', value: '*', description: '"*"' },
{ type: 'literal', value: '*=', description: '"*="' },
{ type: 'literal', value: '+', description: '"+"' },
{ type: 'literal', value: '++', description: '"++"' },
{ type: 'literal', value: '+=', description: '"+="' },
{ type: 'literal', value: ',', description: '","' },
{ type: 'literal', value: '-', description: '"-"' },
{ type: 'literal', value: '--', description: '"--"' },
{ type: 'literal', value: '-=', description: '"-="' },
{ type: 'literal', value: '/', description: '"/"' },
{ type: 'literal', value: '/*', description: '"/*"' },
{ type: 'literal', value: '//', description: '"//"' },
{ type: 'literal', value: '/=', description: '"/="' },
{ type: 'literal', value: ';', description: '";"' },
{ type: 'literal', value: '<', description: '"<"' },
{ type: 'literal', value: '<<', description: '"<<"' },
{ type: 'literal', value: '<<=', description: '"<<="' },
{ type: 'literal', value: '<=', description: '"<="' },
{ type: 'literal', value: '=', description: '"="' },
{ type: 'literal', value: '==', description: '"=="' },
{ type: 'literal', value: '===', description: '"==="' },
{ type: 'literal', value: '>', description: '">"' },
{ type: 'literal', value: '>=', description: '">="' },
{ type: 'literal', value: '>>', description: '">>"' },
{ type: 'literal', value: '>>=', description: '">>="' },
{ type: 'literal', value: '>>>', description: '">>>"' },
{ type: 'literal', value: '>>>=', description: '">>>="' },
{ type: 'literal', value: '?', description: '"?"' },
{ type: 'literal', value: '^', description: '"^"' },
{ type: 'literal', value: '^=', description: '"^="' },
{ type: 'literal', value: 'in', description: '"in"' },
{ type: 'literal',
value: 'instanceof',
description: '"instanceof"' },
{ type: 'literal', value: '|', description: '"|"' },
{ type: 'literal', value: '|=', description: '"|="' },
{ type: 'literal', value: '||', description: '"||"' },
{ type: 'other', description: 'comment' },
{ type: 'other', description: 'end of line' },
{ type: 'other', description: 'whitespace' } ],
found: 'f',
location:
{ start: { offset: 611, line: 26, column: 21 },
end: { offset: 612, line: 26, column: 22 } },
name: 'SyntaxError' }
from solgraph.
Thanks for reporting! Can you paste here line 26 of your contract where the error is occurring (with a few lines above and below for context)?
from solgraph.
A lot of the parsing errors got fixed with solidity-parser v0.1.0. If the problem persists, feel free to reopen. If there is a rendering issue, please create a new issue. Thanks!
from solgraph.
Related Issues (20)
- Add support for multiple solidity files HOT 3
- Installation failure HOT 3
- Installation error: "babel: not found" HOT 7
- constructor and fallback labeled null HOT 1
- Installation Error on Ubuntu 16.04, 64bit HOT 7
- Update color semantics HOT 1
- Remove require() from graphs
- Cannot find module '@babel/preset-es2015' HOT 13
- Cannot find module '@babel/preset-es2015' from '......./node_modules/solgraph' HOT 1
- solgraph is failing on installation HOT 1
- Parsing of solidity 0.5 contract fails HOT 2
- Include `import`ed source files
- Parsing fails on pragma statement in solc 0.6.11 HOT 3
- Throw error when meet abstract contract. HOT 3
- Parse error with immutable property HOT 2
- peg$syntaxerror - address payable recipient HOT 2
- Pass multiple solidity files HOT 2
- Parse Error when pragma statement includes Logical OR (||) operator HOT 2
- parse error with abi coder HOT 2
- peg$SyntaxError: Expected ";", "=", comment, end of line, or whitespace but "D" found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solgraph.