You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala>deflog[T](x: sourcecode.Text[T]) = println(s"[${x.source}]: ${x.value}")
log: [T](x: sourcecode.Text[T])Unit
scala> log(("omg"->"omg").toString)
["omg"->"omg"]: (omg,omg)
scala>// should have printed [("omg" -> "omg").toString]: (omg,omg)
As far as I can tell, Scalac sets the pos of the overall tree provided to the macro to the pos of the ->. There thus just isn't any pos anywhere at all which starts at the first (, which is what we'd want.
OTOH, we can tell when we're falling short, since the last pos within the tree should be within the range we parse. We may have to do a hacky parse-search to try and find a place where the parse encompasses all poss in the captured AST
The text was updated successfully, but these errors were encountered:
As far as I can tell, Scalac sets the
pos
of the overall tree provided to the macro to thepos
of the->
. There thus just isn't anypos
anywhere at all which starts at the first(
, which is what we'd want.OTOH, we can tell when we're falling short, since the last
pos
within the tree should be within the range we parse. We may have to do a hacky parse-search to try and find a place where the parse encompasses allpos
s in the captured ASTThe text was updated successfully, but these errors were encountered: