generate-contract-interface icon indicating copy to clipboard operation
generate-contract-interface copied to clipboard

Parsing error during interface generation

Open gsscoder opened this issue 2 years ago • 0 comments

The source file is in our repo branch (if not found, please check master - maybe we merged a PR): OutwavePublicLock.sol

Here the command and error output:

$ get-content -raw C:\Demind\outwave\outwave-solidity\contracts\OutwavePublicLock.sol | npx generate-contract-interface --importRoot .\contracts\

peg$SyntaxError: Expected "!=", "!==", "%", "%=", "&", "&&", "&=", "*", "*=", "+", "++", "+=", "-", "--", "-=", "/", "/*", "//", "/=", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", "?", "^", "^=", "in", "|", "|=", "||", comment, end of line or whitespace but "(" found. Line: 42, Column: 21
    at peg$buildException (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\node_modules\solidity-parser\build\parser.js:1151:14)
    at Object.peg$parse [as parse] (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\node_modules\solidity-parser\build\parser.js:15033:13)
    at Object.parse (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\node_modules\solidity-parser\index.js:34:23)
    at generateInterface (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\index.js:84:30)
    at C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\bin.js:20:16
    at tryCatch (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\node_modules\rsvp\dist\rsvp.js:525:12)
    at invokeCallback (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\node_modules\rsvp\dist\rsvp.js:538:13)
    at publish (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\node_modules\rsvp\dist\rsvp.js:508:7)
    at flush (C:\ProgramData\nvm\v16.14.2\node_modules\generate-contract-interface\node_modules\rsvp\dist\rsvp.js:2415:5)
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  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: 'in', description: '"in"' },
    { 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: '(',
  location: {
    start: { offset: 1908, line: 42, column: 21 },
    end: { offset: 1909, line: 42, column: 22 }
  }
}

I'm running Node version 16.14.2 on Windows 11.

gsscoder avatar Nov 03 '22 08:11 gsscoder