From 05e302de53ff42bf2602b66efd97c9058e5e9fad Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 24 Jan 2012 14:09:59 -0800 Subject: Moved some code. From ConsoleReporter to Position so others can use it. --- .../scala/tools/nsc/reporters/ConsoleReporter.scala | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/compiler/scala/tools/nsc/reporters') diff --git a/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala b/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala index 967b582f11..c76a04c6ba 100644 --- a/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala +++ b/src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala @@ -47,20 +47,7 @@ class ConsoleReporter(val settings: Settings, reader: BufferedReader, writer: Pr /** Prints the message with the given position indication. */ def printMessage(posIn: Position, msg: String) { - val pos = if (posIn eq null) NoPosition - else if (posIn.isDefined) posIn.inUltimateSource(posIn.source) - else posIn - pos match { - case FakePos(fmsg) => - printMessage(fmsg+" "+msg) - case NoPosition => - printMessage(msg) - case _ => - val buf = new StringBuilder(msg) - val file = pos.source.file - printMessage((if (shortname) file.name else file.path)+":"+pos.line+": "+msg) - printSourceLine(pos) - } + printMessage(Position.formatMessage(posIn, msg, shortname)) } def print(pos: Position, msg: String, severity: Severity) { printMessage(pos, clabel(severity) + msg) -- cgit v1.2.3