diff options
Diffstat (limited to 'src/scaladoc')
-rw-r--r-- | src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala | 8 | ||||
-rwxr-xr-x | src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala b/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala index fe5ed47d43..212f94c531 100644 --- a/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala +++ b/src/scaladoc/scala/tools/nsc/doc/ScaladocAnalyzer.scala @@ -9,7 +9,7 @@ package doc import scala.tools.nsc.ast.parser.{ SyntaxAnalyzer, BracePatch } import typechecker.Analyzer import scala.reflect.internal.Chars._ -import scala.reflect.internal.util.{ BatchSourceFile, RangePosition } +import scala.reflect.internal.util.{ BatchSourceFile, Position } import scala.tools.nsc.doc.base.{ CommentFactoryBase, MemberLookupBase, LinkTo, LinkToExternal } trait ScaladocAnalyzer extends Analyzer { @@ -56,7 +56,7 @@ trait ScaladocAnalyzer extends Analyzer { def stringParser(str: String): syntaxAnalyzer.Parser = { val file = new BatchSourceFile(context.unit.source.file, str) { override def positionInUltimateSource(pos: Position) = { - pos.withSource(context.unit.source, useCase.pos.start) + pos withSource context.unit.source withShift useCase.pos.start } } newUnitParser(new CompilationUnit(file)) @@ -216,7 +216,7 @@ abstract class ScaladocSyntaxAnalyzer[G <: Global](val global: G) extends Syntax // emit a block comment; if it's double-star, make Doc at this pos def foundStarComment(start: Int, end: Int) = try { val str = docBuffer.toString - val pos = new RangePosition(unit.source, start, start, end) + val pos = Position.range(unit.source, start, start, end) unit.comment(pos, str) if (inDocComment) lastDoc = DocComment(str, pos) @@ -240,7 +240,7 @@ abstract class ScaladocSyntaxAnalyzer[G <: Global](val global: G) extends Syntax t => DocDef(doc, t) setPos { if (t.pos.isDefined) { - val pos = doc.pos.withEnd(t.pos.endOrPoint) + val pos = doc.pos.withEnd(t.pos.end) // always make the position transparent pos.makeTransparent } else { diff --git a/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala index b381176b17..86a7a67160 100755 --- a/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/TreeFactory.scala @@ -27,8 +27,8 @@ trait TreeFactory { thisTreeFactory: ModelFactory with TreeFactory => rhs.pos match { case pos: RangePosition => { val source: SourceFile = pos.source - val firstIndex = pos.startOrPoint - val lastIndex = pos.endOrPoint + val firstIndex = pos.start + val lastIndex = pos.end assert(firstIndex < lastIndex, "Invalid position indices for tree " + rhs + " (" + firstIndex + ", " + lastIndex + ")") expr.appendAll(source.content, firstIndex, lastIndex - firstIndex) @@ -39,8 +39,8 @@ trait TreeFactory { thisTreeFactory: ModelFactory with TreeFactory => * stores it in tree.refs with its position */ def makeLink(rhs: Tree){ - val start = pos.startOrPoint - firstIndex - val end = pos.endOrPoint - firstIndex + val start = pos.start - firstIndex + val end = pos.end - firstIndex if(start != end) { var asym = rhs.symbol if (asym.isClass) makeTemplate(asym) match{ |