Skip to content

Parsing fragments #24

@andrewbaxter

Description

@andrewbaxter

Is your feature request related to a problem? Please describe.
I sometimes need to parse fragments of files that are complete subtrees.

Describe the solution you'd like
ParserParsers for all rules?

Describe alternatives you've considered
I can add fake text around the fragment to turn it into a valid full document, but this messes with line numbers and if the user supplied a non-fragment it could end up making the error messages confusing (referring to input that the user didn't originally supply).

Additional context
Maybe this is already possible... I dug around and didn't see an obvious way to do it. The only ParserParser generated seems to be for the root of the grammar and I didn't see a simple way to set up the state for other rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions