diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-08-07 11:19:40 +0200 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-08-08 13:30:58 +0200 |
commit | 36524c21964696ec71170970c6a65f9bb7aec8f0 (patch) | |
tree | 7f4dd7f6ea5aaa42b2d473f5095d5134924f7c66 /test/files/run/t7331c.scala | |
parent | e9ccb416b307d853120411572a57cb57867a9afc (diff) | |
download | scala-36524c21964696ec71170970c6a65f9bb7aec8f0.tar.gz scala-36524c21964696ec71170970c6a65f9bb7aec8f0.tar.bz2 scala-36524c21964696ec71170970c6a65f9bb7aec8f0.zip |
SI-7331 tb.parse returns unpositioned trees
This commit gets rid off code wrapping that was previously used by
toolbox to get into correct parsing mode. Instead combination of
templateStats/accept(EOF) is used. This is the same solution as the one
used in repl and built-in scriptRunner
This pull request doesn't attempt to generalize this approach in any
way and re-use it all over the place due to the caution of possible
accidental compatibility breakage. I plan to do it separately against
master.
Additionally there are a few more changes that make importers be aware
of positions and a test for that (via @jedesah).
Diffstat (limited to 'test/files/run/t7331c.scala')
-rw-r--r-- | test/files/run/t7331c.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/t7331c.scala b/test/files/run/t7331c.scala new file mode 100644 index 0000000000..75873afcd0 --- /dev/null +++ b/test/files/run/t7331c.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends App { + val tb = cm.mkToolBox() + val tree = tb.parse("class C").asInstanceOf[ClassDef] + println(showRaw(tree)) + println(tree.pos) + println(tree.impl.self.pos) +}
\ No newline at end of file |