summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/reporters
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-24 14:09:59 -0800
committerPaul Phillips <paulp@improving.org>2012-01-24 14:10:47 -0800
commit05e302de53ff42bf2602b66efd97c9058e5e9fad (patch)
tree59453a0af0e3832bd9e1e56fccc1c07d8a8a061a /src/compiler/scala/tools/nsc/reporters
parenteb561e364eb82150851d7f80a57abee76dac1201 (diff)
downloadscala-05e302de53ff42bf2602b66efd97c9058e5e9fad.tar.gz
scala-05e302de53ff42bf2602b66efd97c9058e5e9fad.tar.bz2
scala-05e302de53ff42bf2602b66efd97c9058e5e9fad.zip
Moved some code.
From ConsoleReporter to Position so others can use it.
Diffstat (limited to 'src/compiler/scala/tools/nsc/reporters')
-rw-r--r--src/compiler/scala/tools/nsc/reporters/ConsoleReporter.scala15
1 files changed, 1 insertions, 14 deletions
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)