Skip to content

Support for node traversal and matching #65

@jonathanhogg

Description

@jonathanhogg

Since I ditched queries, I haven't revisited the idea of manipulating a node tree. However, since I have recursive functions now, rewriting a tree ought to be a simpler operation. What's missing is:

  • iterating over the children of a node
  • matching on a node kind, tags or attributes
  • retrieving the value of a node attribute

An additional nice to have would be:

  • syntax for binding a name to a tree

Adding these operations would allow for manipulating trees, but also allow nodes to be used as arbitrary data structures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    💡 ideaA hair-brained concept💬 languageAnything to do with the parser/evaluator/VM🚀 enhancementNew feature or request🧱 modelAnything to do with the underlying graph/value model

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions