Browse files

toCode renamed to showCode

  • Loading branch information...
1 parent 3989227 commit d680d23947778a963ec23580efccbf2527f3a97c @VladimirNik VladimirNik committed Jan 13, 2014
View
4 src/reflect/scala/reflect/api/Printers.scala
@@ -212,10 +212,10 @@ trait Printers { self: Universe =>
*
* @group Printers
*/
- def toCode(tree: Tree) = render(tree, newCodePrinter)
+ def showCode(tree: Tree) = render(tree, newCodePrinter)
/**
- * Hook to define what `toCode(...)` means.
+ * Hook to define what `showCode(...)` means.
* @group Printers
*/
protected def newCodePrinter(out: PrintWriter): TreePrinter
View
2 src/reflect/scala/reflect/internal/Printers.scala
@@ -580,7 +580,7 @@ trait Printers extends api.Printers { self: SymbolTable =>
case Select(qual, name) if name.isTermName => s"${resolveSelect(qual)}.${printedName(name)}"
case Select(qual, name) if name.isTypeName => s"${resolveSelect(qual)}#${blankForOperatorName(name)}%${printedName(name)}"
case Ident(name) => printedName(name)
- case _ => toCode(t)
+ case _ => showCode(t)
}
}
View
4 test/junit/scala/reflect/internal/PrintersTest.scala
@@ -25,8 +25,8 @@ object PrinterHelper {
} catch {
case e:scala.tools.reflect.ToolBoxError => throw new Exception(e.getMessage + ": " + code)
}
- if (tree ne EmptyTree) assertEquals("using quasiquote or given tree"+"\n", code.trim, toCode(tree))
- else assertEquals("using toolbox parser", code.trim, toCode(toolboxTree))
+ if (tree ne EmptyTree) assertEquals("using quasiquote or given tree"+"\n", code.trim, showCode(tree))
+ else assertEquals("using toolbox parser", code.trim, showCode(toolboxTree))
}
implicit class StrContextStripMarginOps(val stringContext: StringContext) extends util.StripMarginInterpolator

0 comments on commit d680d23

Please sign in to comment.