Parse errors
See original GitHub issueFantastic, I have been looking for s.th. like this for a long time; really happy solgraph
was mentioned in Hudson Jameson’s DevCon3 talk last week.
Small issue - I get parser errors for some contracts.
How to replicate:
git clone https://github.com/raiden-network/raiden
cd raiden/raiden/smart_contracts/
find . -type f -name "*.sol" -printf "solgraph %p > %p.dot\n" | bash
find . -type f -name "*.dot" -printf "dot -Tpng %p > %p.png\n" | bash
8 out of the 10 contracts are fine, but for two of them (ChannelManagerContract.sol & Token.sol) I get these parser errors:
Parse error
{ SyntaxError: Expected "contract", "import", "library", "pragma", comment, end of input, end of line, or whitespace but "i" found. Line: 3, Column: 1
at peg$buildStructuredError (/usr/lib/node_modules/solgraph/node_modules/solidity-parser/build/parser.js:1272:12)
at Object.peg$parse [as parse] (/usr/lib/node_modules/solgraph/node_modules/solidity-parser/build/parser.js:13858:11)
at Object.parse (/usr/lib/node_modules/solgraph/node_modules/solidity-parser/index.js:34:23)
at exports.default (/usr/lib/node_modules/solgraph/dist/index.js:70:21)
at /usr/lib/node_modules/solgraph/dist/bin.js:37:35
message: 'Expected "contract", "import", "library", "pragma", comment, end of input, end of line, or whitespace but "i" found. Line: 3, Column: 1',
expected:
[ { type: 'other', description: 'whitespace' },
{ type: 'other', description: 'end of line' },
{ type: 'other', description: 'comment' },
{ type: 'literal', text: 'pragma', ignoreCase: false },
{ type: 'literal', text: 'import', ignoreCase: false },
{ type: 'literal', text: 'import', ignoreCase: false },
{ type: 'literal', text: 'import', ignoreCase: false },
{ type: 'literal', text: 'contract', ignoreCase: false },
{ type: 'literal', text: 'library', ignoreCase: false },
{ type: 'other', description: 'whitespace' },
{ type: 'other', description: 'end of line' },
{ type: 'other', description: 'comment' },
{ type: 'end' } ],
found: 'i',
location:
{ start: { offset: 26, line: 3, column: 1 },
end: { offset: 27, line: 3, column: 2 } },
name: 'SyntaxError' }
Parse error
{ SyntaxError: Expected comment, end of line, identifier, or whitespace but "," found. Line: 104, Column: 28
at peg$buildStructuredError (/usr/lib/node_modules/solgraph/node_modules/solidity-parser/build/parser.js:1272:12)
at Object.peg$parse [as parse] (/usr/lib/node_modules/solgraph/node_modules/solidity-parser/build/parser.js:13858:11)
at Object.parse (/usr/lib/node_modules/solgraph/node_modules/solidity-parser/index.js:34:23)
at exports.default (/usr/lib/node_modules/solgraph/dist/index.js:70:21)
at /usr/lib/node_modules/solgraph/dist/bin.js:37:35
message: 'Expected comment, end of line, identifier, or whitespace but "," found. Line: 104, Column: 28',
expected:
[ { type: 'other', description: 'whitespace' },
{ type: 'other', description: 'end of line' },
{ type: 'other', description: 'comment' },
{ type: 'other', description: 'identifier' } ],
found: ',',
location:
{ start: { offset: 3407, line: 104, column: 28 },
end: { offset: 3408, line: 104, column: 29 } },
name: 'SyntaxError' }
These are all the images of those contracts which succeed getting parsed: raiden-solidity-solgraph-for-printing.pdf Really great, thanks a lot!
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Parse Error: What It Is and How to Fix It - Lifewire
A parse error is an error message you sometimes get on Android devices when an app fails to install. The message itself is...
Read more >6 Methods to Fix Parse Error on Your Android Device - MiniTool
The Parse Error is an error message you may receive on your Android phone when an application fails to install. This error message...
Read more >What is a parse error? - Quora
A parse error in a piece of computer code, also known as a syntax error, prevents your program from compiling. Parse errors happen...
Read more >Formula Parse Errors In Google Sheets And How To Fix Them
Before we get into the different types of errors, you might be wondering what does formula parse error mean? Essentially, it means Google...
Read more >What is a Parse Error? - IONOS Help
If the PHP code contains a syntax error, the PHP parser cannot interpret the code and stops working. For example, a syntax error...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you! This should be remedied as soon as we upgrade to the latest version of solidity.
this now seems to work fine:
and there is one
png
file for eachsol
file: