aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/Reporter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-15 18:48:20 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-15 18:48:20 +0100
commit1d029f5f8f90a909ed140f7ef5cf656fafd9fc27 (patch)
treed7ed9423ebbd7b700f49c41f59da80963d68a6cf /src/dotty/tools/dotc/reporting/Reporter.scala
parent0d2fd0fd49fb1b6d4ab344ae32da493b36c99ba7 (diff)
downloaddotty-1d029f5f8f90a909ed140f7ef5cf656fafd9fc27.tar.gz
dotty-1d029f5f8f90a909ed140f7ef5cf656fafd9fc27.tar.bz2
dotty-1d029f5f8f90a909ed140f7ef5cf656fafd9fc27.zip
Various fixes to make classfile loading work.
Can now read and display info of verious classfiles as listed in the showClass test. Great end of the week!
Diffstat (limited to 'src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/Reporter.scala17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala
index 723af8768..dac2b6874 100644
--- a/src/dotty/tools/dotc/reporting/Reporter.scala
+++ b/src/dotty/tools/dotc/reporting/Reporter.scala
@@ -36,15 +36,26 @@ trait Reporting { this: Context =>
value
}
- def traceIndented[T](leading: => String, trailing: => String)(op: => T): T =
+ def traceIndented[T](leading: => String, trailing: => String)(op: => T): T = {
+ var finalized = false
+ def finalize(note: String) =
+ if (!finalized) {
+ base.indent -= 1
+ log(s"${base.indentTab * base.indent}$trailing$note")
+ finalized = true
+ }
try {
log(s"${base.indentTab * base.indent}$leading")
base.indent += 1
op
+ } catch {
+ case ex: Throwable =>
+ finalize(s" (with exception $ex)")
+ throw ex
} finally {
- base.indent -= 1
- log(s"${base.indentTab * base.indent}$trailing")
+ finalize("")
}
+ }
}
object Reporter {