raineorshine/solgraph

peg$SyntaxError: Expected ";", "=", comment, end of line, or whitespace but "D" found

jonasms opened this issue · 3 comments

I'm having trouble running solgraph.

Running the following in zsh:

node ~/.yarn/bin/solgraph Resonate.sol > Resonate.dot
Parse error
peg$SyntaxError: Expected ";", "=", comment, end of line, or whitespace but "D" found. Line: 56, Column: 31
    at peg$buildStructuredError (/Users/jonassota/.config/yarn/global/node_modules/solidity-parser-sc/build/parser.js:1376:12)
    at Object.peg$parse [as parse] (/Users/jonassota/.config/yarn/global/node_modules/solidity-parser-sc/build/parser.js:15723:11)
    at Object.parse (/Users/jonassota/.config/yarn/global/node_modules/solidity-parser-sc/index.js:34:23)
    at _default (/Users/jonassota/.config/yarn/global/node_modules/solgraph/dist/index.js:69:21)
    at /Users/jonassota/.config/yarn/global/node_modules/solgraph/dist/bin.js:23:37 {
  expected: [
    { type: 'other', description: 'whitespace' },
    { type: 'other', description: 'end of line' },
    { type: 'other', description: 'comment' },
    { type: 'literal', text: '=', ignoreCase: false },
    { type: 'other', description: 'whitespace' },
    { type: 'other', description: 'end of line' },
    { type: 'other', description: 'comment' },
    { type: 'other', description: 'whitespace' },
    { type: 'other', description: 'end of line' },
    { type: 'other', description: 'comment' },
    { type: 'literal', text: ';', ignoreCase: false }
  ],
  found: 'D',
  location: {
    start: { offset: 1643, line: 56, column: 31 },
    end: { offset: 1644, line: 56, column: 32 }
  }
}

2.node ~/.yarn/bin/solgraph Resonate.sol > Resonate.dot strict digraph { Resonate } zsh: parse error near }'`

In both cases, an empty Resonate.dot file is created.

The parser needs to be updated from solidity-parser-sc to solidity-parser-antlr or another parser that supports the latest solc. I am no longer actively working on this project but I would be happy to support a PR from anyone who is interested in contributing.

The parser needs to be updated from solidity-parser-sc to solidity-parser-antlr or another parser that supports the latest solc. I am no longer actively working on this project but I would be happy to support a PR from anyone who is interested in contributing.

Would you mind reviewing my PR #49

Should be fixed in v1.0.0 thanks to @yellowBirdy.

@JonasMS If it still doesn't work, please post your Resonate.sol.