GithubHelp home page GithubHelp logo

Comments (4)

raineorshine avatar raineorshine commented on April 28, 2024 1

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.

elenadimitrova avatar elenadimitrova commented on April 28, 2024

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.

raineorshine avatar raineorshine commented on April 28, 2024

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.

raineorshine avatar raineorshine commented on April 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.