treeCopy and intrinsic references
Usually, treeCopy()
is used to copy subtrees. The copying process copies terminal values directly, and, since intrinsic references are treated as terminal values, it also copies those directly.
There are two cases to consider:
- the intrinsic reference points outside of the copied fragment. In this case, the value of the intrinsic reference can be copied.
- the intrinsic reference points to a non-terminal in the subtree to be copied. In this case, the value of the reference should probably point to the copy of the old target.
Proposed change: treeCopy() has to be modified for all nonterminal types containing intrinsic references.