Asked by Oskar van Rest on 4 June 2013 at 18:14

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 s directly, you should therefore call origin-track-forced(s) in cases like these.

Answered by Oskar van Rest on 4 June 2013 at 18:14