Skip to content

Add comments to the parsed AST #103

@rattrayalex

Description

@rattrayalex

Follow-on issue to #15 and #43

As of pg_query 2.0, comment tokens are included in the scan output!

This is accomplished with a patch in the lexer, and this could similarly be implemented with a patch to the parser (though it may be a heavier lift).

Alternatively, adding start/end location data to all nodes in the parsed AST may provide much of the same purpose (making it easier to match AST nodes with comments in the scanner) and could be simpler to implement.

@lfittl has indicated he does not have time to build this in the near-term, but would be open to reviewing a PR for this.

(I'm interested in doing this myself but am not likely to be able to in the near future either.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions