So I googl'ed a bit, but no information other than the sparse:
-Yrangepos Use range positions for syntax trees.
Ok. And I know I need to use it if I want to capture source fragments in a macro.
Now my two questions are:
- why is this not on by default?
- are there any side-effects to using it (such as increasing the class file size)?
The issue introducing
-Yrangepos
back when makro was spelt Burmak(r)o is motivated by your use case.A
-X
option suggests permanence, while a-Y
could disappear at any time, which means it could become the default behavior.Perhaps it hasn't because of bugs and crashes.
At a team meeting written up by Moors:
In 2012, PR validation with
-Yrangepos
failed frequently; it was fixed, but turned into a nightly validation to reduce resources.Hubert offered these notes:
It might seem easy to switch to range positions, because basic math, but there are still bugs like this one that demonstrate the extra labor involved in assigning positions when synthesizing or restructuring a tree.
Although range positions are needed for the presentation compiler, they aren't in the critical path for batch compilation. With more resources to improve robustness, maybe they could flip the switch.