Skip to content

Natspec parsing? #82

@lnist

Description

@lnist

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions