Skip to content

Change value of node #773

@ostronom

Description

@ostronom

Hello. I am writing a JSON preprocessor, that applies some transformations to ast.Node and I've stumbled upon the impossibility to change value of ast.Node itself.

For example, if I've located a numeric node by path and I want to change its value to the result of some algebraic expression, there is currently no way of doing it, because it's not "Set", since there is no "key". The only solution is to backtrack node position in ASTree and change node value from there, but it involves a lot if code with lots of edge cases for such a task.

Is there a possibility of adding this in next versions or there is an easy way of doing this which I am not seeing?

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