mirror of https://github.com/Wilfred/difftastic/
24 lines
432 B
Scala
24 lines
432 B
Scala
package foo
|
|
|
|
// A Scala program.
|
|
import foo.Bar
|
|
|
|
class Foo {
|
|
|
|
def blah(): Int {
|
|
/* foo */
|
|
throw new Exception("before");
|
|
}
|
|
|
|
var result = Option.empty[T]
|
|
object traverser extends SimpleTraverser {
|
|
override def apply(t: Tree): Unit = {
|
|
if (result.isEmpty && pf.isDefinedAt(t)) {
|
|
result = Some(pf(t))
|
|
} else if (result.isEmpty) {
|
|
super.apply(t)
|
|
}
|
|
}
|
|
}
|
|
}
|