Introduce a mechanism to duplicate/clone a node and all it's children?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2k
- Forks
- 691
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 1
Description
When manipulating ASTs using nodes, sometimes you need to copy parts of the AST to a different place or part of the document.
The most naive approach I can think of is converting a document to a markdown string and parsing it again, but I'm sure there are subtle differences. It might be good for an initial implementation.
It might be nice to introduce a clone function which takes a node and returns a copy, including all children.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the AST node and document APIs, then trace how parsing constructs and links child nodes. Compare the proposed clone operation with a markdown round-trip and identify the ownership and metadata questions it must resolve. Done means a settled mechanism for copying a node and all its children without changing the original tree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100