Skip to content

Syntax wrappers #313

@AntonC9018

Description

@AntonC9018

Digging through the syntax tree in search of certain nodes is not maintainable - the code becomes cryptic even for simple grammars. Is there a way to generate convenient type-safe wrappers for any syntactic construct? They can be done as wrappers over raw nodes.

For example:
Usage with wrappers (manually written out)
And the grammar + wrappers themselves:

The same code without said wrappers, with digging through the syntax tree done manually, inline

The way I did it is not necessarily optimal, but I think it's pretty plausible.
From experience working with Roslyn, it's a real good thing.

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