diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/macroPlugins-namerHooks.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/files/run/macroPlugins-namerHooks.scala b/test/files/run/macroPlugins-namerHooks.scala index a71d685f7f..302429b19e 100644 --- a/test/files/run/macroPlugins-namerHooks.scala +++ b/test/files/run/macroPlugins-namerHooks.scala @@ -14,19 +14,20 @@ object Test extends DirectTest { import analyzer._ val output = collection.mutable.ListBuffer[String]() + def log(what: String) = output += what.replace(String.format("%n"), " ") object macroPlugin extends MacroPlugin { override def pluginsEnterSym(namer: Namer, tree: Tree): Boolean = { - output += s"enterSym(${tree.toString.replace('\n', ' ')})" + log(s"enterSym($tree)") namer.standardEnterSym(tree) true } override def pluginsEnsureCompanionObject(namer: Namer, cdef: ClassDef, creator: ClassDef => Tree = companionModuleDef(_)): Option[Symbol] = { - output += s"ensureCompanionObject(${cdef.toString.replace('\n', ' ')}, ...)" + log(s"ensureCompanionObject($cdef, ...)") Some(namer.standardEnsureCompanionObject(cdef, creator)) } override def pluginsEnterStats(typer: Typer, stats: List[Tree]): List[Tree] = { - stats.foreach(stat => output += s"enterStat(${stat.toString.replace('\n', ' ')})") + stats.foreach(stat => log(s"enterStat($stat)")) stats } } |