Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Natspec parsing? #82

Open
lnist opened this issue Mar 8, 2023 · 1 comment
Open

Natspec parsing? #82

lnist opened this issue Mar 8, 2023 · 1 comment

Comments

@lnist
Copy link

lnist commented Mar 8, 2023

In the old repo there was some work on parsing natspec, see federicobond/solidity-parser-antlr#82 . Is it supposed to be merged here?

I tried

const parser = require('@solidity-parser/parser');

const input = `
    contract test {
        uint256 a;
        ///@notice foo
        ///@param a bar
        function f(uint a) {}
    }
`
try {
    const ast = parser.parse(input)
    console.log(ast.children[0].subNodes[1])
} catch (e) {
    if (e instanceof parser.ParserError) {
        console.error(e.errors)
    }
}

But I don't see anything related to natspec. It would be nifty since solhint could then use it to warn on missing natspec for params/returns.

@fvictorio
Copy link
Contributor

Not planned, to be honest. This would mean changing a lot how comments are handled by the grammar, and I don't think I'll have the bandwidth to do it. Of course, if someone wants to give it a shot, PRs are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants