If a rule initialises a Term as output, and the origin has to be preserved, e.g. desugar = origin-track-forced(?BoolDT(); !"a"), the resulting origin will always point to the origin of the Term where the rules was successfully triggered the first time. So if I have multiple occurrences of BoolDT() in my AST, they all get replaced by "a", but their origins all point to the original origin of the first BoolDT(). This origin seems to be statically bound to the rule, as it even persist between different files, and adding new BoolDT() nodes earlier in the AST does not override the origin.


As far as I can tell it occurs only on String Terms, not on Integer Terms and Terms with a Constructor.


I’m using:
Eclipse: org.eclipse.platform.ide 4.5.2.M20160212-1500
Spoofax: org.metaborg.spoofax.eclipse 2.0.0.beta1
System: Windows 7 amd64 6.1

Submitted by Jeffrey Goderie on 9 June 2016 at 14:50

Log in to post comments