diff options
author | Martin Odersky <odersky@gmail.com> | 2009-05-28 14:12:26 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-05-28 14:12:26 +0000 |
commit | 578d4c671696ec6db3c44dec82bf11d90c65d819 (patch) | |
tree | 320874513badd5a748e20c2d67f23ab4f6444377 /src/compiler/scala/tools/nsc/interactive/Global.scala | |
parent | b7eac378dadaac07aa77a9acfc8a64b212c09e83 (diff) | |
download | scala-578d4c671696ec6db3c44dec82bf11d90c65d819.tar.gz scala-578d4c671696ec6db3c44dec82bf11d90c65d819.tar.bz2 scala-578d4c671696ec6db3c44dec82bf11d90c65d819.zip |
more work on rangepositions.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/Global.scala')
-rwxr-xr-x | src/compiler/scala/tools/nsc/interactive/Global.scala | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala index 44001b4b64..fb448aafc0 100755 --- a/src/compiler/scala/tools/nsc/interactive/Global.scala +++ b/src/compiler/scala/tools/nsc/interactive/Global.scala @@ -11,7 +11,11 @@ import scala.tools.nsc.ast._ /** The main class of the presentation compiler in an interactive environment such as an IDE */ class Global(settings: Settings, reporter: Reporter) - extends nsc.Global(settings, reporter) with CompilerControl with ContextTrees with RichCompilationUnits { + extends nsc.Global(settings, reporter) + with CompilerControl + with Positions + with ContextTrees + with RichCompilationUnits { self => /** A list indicating in which order some units should be typechecked. @@ -217,29 +221,6 @@ self => // ---------------- Helper classes --------------------------- - - def validatePositions(tree: Tree) { - def check(condition: Boolean, msg: => String) { - if (!condition) { - println("**** bad positions:") - println(msg) - println("================= in =================") - println(tree) - } - } - def validate(tree: Tree, encltree: Tree, lefttree: Tree) { - if (encltree.pos.isSynthetic) check(tree.pos.isSynthetic, "synthetic "+encltree+" contains nonsynthetic" + tree) - check(encltree.pos includes tree.pos, encltree+" does not include "+tree) - if (lefttree != EmptyTree) check(lefttree.pos precedes tree.pos, lefttree+" does not not precede "+tree) - var newleft: Tree = EmptyTree - for (ct <- tree.children) { - validate(ct, tree, newleft) - newleft = ct - } - } - validate(tree, tree, EmptyTree) - } - /** A transformer that replaces tree `from` with tree `to` in a given tree */ class TreeReplacer(from: Tree, to: Tree) extends Transformer { override def transform(t: Tree): Tree = { |