summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-15 09:28:07 -0700
committerPaul Phillips <paulp@improving.org>2012-03-15 19:59:46 -0700
commitacb2c851720141982514b11b4b34ba68dc868bf2 (patch)
treec6aa85586f6f673e5975266314cc613a7d36ed05 /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
parent2dd0af0675ea0c4d696a46bf36d7bd9406a64cd0 (diff)
downloadscala-acb2c851720141982514b11b4b34ba68dc868bf2.tar.gz
scala-acb2c851720141982514b11b4b34ba68dc868bf2.tar.bz2
scala-acb2c851720141982514b11b4b34ba68dc868bf2.zip
New option -Ypos-debug, and fixed range position breakage.
(Looks like there is more range position breakage yet, but this gets the outermost layer.) Channeling my struggles into a slightly easier future. % scalac -Ypos-debug -d /tmp ./src/library/scala/Predef.scala ./src/library/scala/Predef.scala:222: warning: Positioned tree has unpositioned child in phase extmethods def x = __resultOfEnsuring ^ parent: #7109 line 222 Select // (value __resultOfEnsuring in class Ensuring) child: #7108 Ident // (value $this) ./src/library/scala/Predef.scala:258: warning: Positioned tree has unpositioned child in phase extmethods def x = __leftOfArrow ^ parent: #7280 line 258 Select // (value __leftOfArrow in class ArrowAssoc) child: #7279 Ident // (value $this) two warnings found Or try this to really see some output: % scalac -Yrangepos -Ypos-debug
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index ab6125df61..ccebcfa54d 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -394,7 +394,7 @@ self =>
// object Main
def moduleName = newTermName(ScriptRunner scriptMain settings)
- def moduleBody = Template(List(scalaAnyRefConstr), emptyValDef, List(emptyInit, mainDef))
+ def moduleBody = Template(List(atPos(o2p(in.offset))(scalaAnyRefConstr)), emptyValDef, List(emptyInit, mainDef))
def moduleDef = ModuleDef(NoMods, moduleName, moduleBody)
// package <empty> { ... }
@@ -2738,7 +2738,7 @@ self =>
def anyrefParents() = {
val caseParents = if (mods.isCase) List(productConstr, serializableConstr) else Nil
parents0 ::: caseParents match {
- case Nil => List(scalaAnyRefConstr)
+ case Nil => List(atPos(o2p(in.offset))(scalaAnyRefConstr))
case ps => ps
}
}