@abcoathup:
And what about the solc version? Is there any way to force an earlier one (0.4.24 instead of 0.5.9)?
In any case, in order to test your tool, I’ve simply copied the solc folder under the truffle package, and used it to override the one under the solidity-docgen package.
When running node_modules\.bin\solidity-docgen -c path_to_my_contracts, I get:
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at compile (.....\node_modules\solidity-docgen\dist\gather\solidity\compile.js:50:27)
at <anonymous>
Line 50 in compile.js is:
const solcOutput = JSON.parse(solcOutputString);
I printed solcOutputString beforehand, and got:
{ contracts: {},
errors: [ ':1:1: ParserError: Expected pragma, import directive or contract/interface/library definition.\n ... { ... \n ^\n' ],
sourceList: [ '' ],
sources: {} }
This string is actually the output of the previous line:
const solcOutputString = _solc.default.compile(JSON.stringify(inputJSON));
And this is the object which is passed to the compile function:
const inputJSON = {
language: "Solidity",
sources: sources,
settings: compilerSettings
};
I checked the contents of sources, and it seemed fine. For example, it starts with:
{ 'solidity/contracts/BancorConverterRegistry.sol': { content: 'pragma solidity ^0.4.24;\r\nimport \'./utility/Owned.sol\';...
This one (above) stands for the first file under my contracts folder (solidity/contracts, which is what I pass to solidity-docgen as the value of the -c argument).
For all it matters, the value of the compilerSettings string (or object) is:
{ outputSelection: { '*': { '': [Array], '*': [Array] } } }
Would it be possible for you to have the dev team to take a look at that? (I’ve communicated with nventuro and frangio in the past and they were great, so perhaps one of them might be involved in this project).
Should they be interested to inspect the repo which I am working on, then it is publicly available at https://github.com/bancorprotocol/contracts.
Thanks again 