Code to locate currently transformed unit in case of crashes. Review by extempore.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25914 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
odersky 2011-10-31 14:56:56 +00:00
parent 5f7b400af5
commit b4f718a459
1 changed files with 8 additions and 1 deletions

View File

@ -201,7 +201,14 @@ trait Trees extends reflect.internal.Trees { self: Global =>
}
class Transformer extends super.Transformer {
def transformUnit(unit: CompilationUnit) { unit.body = transform(unit.body) }
def transformUnit(unit: CompilationUnit) {
try unit.body = transform(unit.body)
catch {
case ex: Exception =>
println("unhandled exception while transforming "+unit)
throw ex
}
}
}
override protected def xtransform(transformer: super.Transformer, tree: Tree): Tree = tree match {