diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-21 15:02:43 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-21 15:02:43 +0100 |
commit | 25f23a443bc6831d1c8d7f6f57212a29e84bbaa5 (patch) | |
tree | e281e0034c7c3de89b1969da1791ab91daf66b54 /src/reflect/scala/reflect/api | |
parent | d79fc2cae4e550bf0a3276a3961ed007bdd428e7 (diff) | |
parent | 48a706dee8f7df9d1a6267b6b117cf1546915506 (diff) | |
download | scala-25f23a443bc6831d1c8d7f6f57212a29e84bbaa5.tar.gz scala-25f23a443bc6831d1c8d7f6f57212a29e84bbaa5.tar.bz2 scala-25f23a443bc6831d1c8d7f6f57212a29e84bbaa5.zip |
Merge pull request #3546 from VladimirNik/typedTreesPrinter-2.11.0
CodePrinter added to Printers 2.11.0
Diffstat (limited to 'src/reflect/scala/reflect/api')
-rw-r--r-- | src/reflect/scala/reflect/api/Printers.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/reflect/scala/reflect/api/Printers.scala b/src/reflect/scala/reflect/api/Printers.scala index b262fdce68..92ae6d8b44 100644 --- a/src/reflect/scala/reflect/api/Printers.scala +++ b/src/reflect/scala/reflect/api/Printers.scala @@ -209,20 +209,22 @@ trait Printers { self: Universe => * Renders the code of the passed tree, so that: * 1) it can be later compiled by scalac retaining the same meaning, * 2) it looks pretty. - * At the moment we have handled #1 for unattributed trees and - * later on plan to account for typical idiosyncrasies of the typechecker. + * #1 is available for unattributed trees and attributed trees * #2 is more or less okay indentation-wise, but at the moment there's a lot of desugaring - * left in place, and that's what we also plan to improve in the future. + * left in place, and that's what we plan to improve in the future. + * printTypes, printIds, printPositions options have the same meaning as for TreePrinter + * printRootPkg option is available only for attributed trees. * * @group Printers */ - def showCode(tree: Tree) = render(tree, newCodePrinter) + def showCode(tree: Tree, printTypes: BooleanFlag = None, printIds: BooleanFlag = None, printOwners: BooleanFlag = None, printPositions: BooleanFlag = None, printRootPkg: Boolean = false) = + render(tree, newCodePrinter(_, tree, printRootPkg), printTypes, printIds, printOwners, printKinds = None, printMirrors = None, printPositions) /** * Hook to define what `showCode(...)` means. * @group Printers */ - protected def newCodePrinter(out: PrintWriter): TreePrinter + protected def newCodePrinter(out: PrintWriter, tree: Tree, printRootPkg: Boolean): TreePrinter /** Renders internal structure of a reflection artifact as the * visualization of a Scala syntax tree. |