summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-12 04:08:58 +0000
committerPaul Phillips <paulp@improving.org>2010-12-12 04:08:58 +0000
commit9c238c6accf43f2bfe9bcfcdc7aa2384e71dc165 (patch)
tree9b738b1815e19f6c9d45fdd3334ccc0ba842a2df
parente61fb59b9db0f5d24fdffe760536c2e5431546f8 (diff)
downloadscala-9c238c6accf43f2bfe9bcfcdc7aa2384e71dc165.tar.gz
scala-9c238c6accf43f2bfe9bcfcdc7aa2384e71dc165.tar.bz2
scala-9c238c6accf43f2bfe9bcfcdc7aa2384e71dc165.zip
That cunning underscore tricked me into quoting...
That cunning underscore tricked me into quoting it and changing some test output. No review.
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreePrinters.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreePrinters.scala b/src/compiler/scala/tools/nsc/ast/TreePrinters.scala
index a99ec1f42f..62865a7643 100644
--- a/src/compiler/scala/tools/nsc/ast/TreePrinters.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreePrinters.scala
@@ -20,7 +20,8 @@ trait TreePrinters { trees: SymbolTable =>
/** Adds backticks if the name is a scala keyword. */
def quotedName(name: Name, decode: Boolean): String = {
val s = if (decode) name.decode else name.toString
- if (nme.keywords(name.toTermName)) "`%s`" format s
+ val term = name.toTermName
+ if (nme.keywords(term) && term != nme.USCOREkw) "`%s`" format s
else s
}
def quotedName(name: Name): String = quotedName(name, false)