In my macro I'm trying to get hold of the exact source code for the macro application. By casting Tree.pos to scala.tools.nsc.util.Position, I can get lineContent and point, but since the position is not a RangePosition, I cannot get start and end. I was hoping that -Yrangepos would give me the range position (even outside the IDE), but it doesn't. Is this expected?
I was also hoping that I can use a Tree's position to determine whether the Tree is compiler-generated or corresponds to user code. However, I haven't been able to figure out a reliable way to do so. (Again, I don't get a TransparentPosition even with -Yrangepos). Is there a way to determine this, with or without using the Tree's position?
Cheers,
Peter