What does 'origin-track-forced' do?
Asked by Oskar van Rest on 4 June 2013 at 18:14
1 Answer
If I understand this correctly, origin information is lost if you change the root node of a tree during transformation.
This is for example the case for the following transformation (if we assume that
Module(name, entities)
has no parent):
s: Module(name, entities) -> Module(name, entities)
origin-track-forced
therefore wraps the root node with some other node before evaluating your strategy. In this way, origin information is preserved because the actual root (i.e. the wrapper) is not changed during evaluation. After evaluation, it unwraps the resulting tree.Rather than calling
Answered by Oskar van Rest on 4 June 2013 at 18:14s
directly, you should therefore callorigin-track-forced(s)
in cases like these.