richard-ramos / solidity-diagram-gen

UML class diagram generator for solidity contracts
MIT License
59 stars 320 forks source link

Wrong command name in README and bug on diagram generation #7

Open nkthiebaut opened 6 years ago

nkthiebaut commented 6 years ago

Hi,

First there's a typo in the README, the command is not solidity-code-gen but solidity-diagram-gen.

Plus, when I run solidity-diagram-gen ./contract on my contract folder (the folder I use is the contract folder of this repo) I get the following bug

Generating diagram...

/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/index.js:39
      throw e;
      ^
SyntaxError: Expected "!", "!=", "(", "+", "++", "-", "--", "0", "<", "<=", "==", ">", ">=", "[", "^", "delete", "false", "hex", "mapping", "new", "this", "true", "v", "~", [1-9], comment, end of line, identifier, number, string, or whitespace but "," found. Line: 55, Column: 6
    at peg$buildStructuredError (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/build/parser.js:1306:12)
    at Object.peg$parse [as parse] (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/build/parser.js:14485:11)
    at Object.parse (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/index.js:34:23)
    at Object.parseFile (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/index.js:45:17)
    at /usr/local/lib/node_modules/solidity-diagram-gen/src/solidity-diagram-gen.js:22:42
    at Array.forEach (<anonymous>)
    at processSolFiles (/usr/local/lib/node_modules/solidity-diagram-gen/src/solidity-diagram-gen.js:21:15)
    at Walker.klaw.on.on (/usr/local/lib/node_modules/solidity-diagram-gen/src/solidity-diagram-gen.js:407:30)
    at Walker.emit (events.js:182:13)
    at endReadableNT (_stream_readable.js:1092:12)
nkthiebaut commented 6 years ago

I found that the line responsible for this bug is the following: (,,,,,,,,,kittyDna) = kittyContract.getKitty(_kittyId); which is a valid solidity syntax.

richard-ramos commented 6 years ago

Hello, @nkthiebaut Thanks for noticing the typo. #6 fixed this. The bug reported occurs inside the solidity-diagram-gen npm module. I'll attempt to solve it.

notOccupanther commented 6 years ago

Receiving the same error when I try to run it. Is there a fix for this ? Would love to try this out

doraemon93 commented 4 years ago

Hi,

First there's a typo in the README, the command is not solidity-code-gen but solidity-diagram-gen.

Plus, when I run solidity-diagram-gen ./contract on my contract folder (the folder I use is the contract folder of this repo) I get the following bug

Generating diagram...

/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/index.js:39
      throw e;
      ^
SyntaxError: Expected "!", "!=", "(", "+", "++", "-", "--", "0", "<", "<=", "==", ">", ">=", "[", "^", "delete", "false", "hex", "mapping", "new", "this", "true", "v", "~", [1-9], comment, end of line, identifier, number, string, or whitespace but "," found. Line: 55, Column: 6
    at peg$buildStructuredError (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/build/parser.js:1306:12)
    at Object.peg$parse [as parse] (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/build/parser.js:14485:11)
    at Object.parse (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/index.js:34:23)
    at Object.parseFile (/usr/local/lib/node_modules/solidity-diagram-gen/node_modules/solidity-parser/index.js:45:17)
    at /usr/local/lib/node_modules/solidity-diagram-gen/src/solidity-diagram-gen.js:22:42
    at Array.forEach (<anonymous>)
    at processSolFiles (/usr/local/lib/node_modules/solidity-diagram-gen/src/solidity-diagram-gen.js:21:15)
    at Walker.klaw.on.on (/usr/local/lib/node_modules/solidity-diagram-gen/src/solidity-diagram-gen.js:407:30)
    at Walker.emit (events.js:182:13)
    at endReadableNT (_stream_readable.js:1092:12)