Skip to content

Can we modify the AST content while visiting nodes? #76

@trannamtrung1st

Description

@trannamtrung1st

Firstly, many thanks for the good work on this project!

I need to rewrite parts of the parsed AST during traversal (e.g., rename identifiers or inject predicates). Does the current visitor support mutating nodes in-place, or is there a supported way to return replacements? If not, could we add a transform/rewriter API?

Example goal:

-- Input
SELECT a FROM t
-- Desired rewrite during visit
SELECT b FROM t

Is that true that I just need to public these properties' setter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions