diff options
author | Lex Spoon <lex@lexspoon.org> | 2007-03-23 16:41:24 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2007-03-23 16:41:24 +0000 |
commit | 156137e6006119bf236f3789324783fd1e0ac3c3 (patch) | |
tree | e2aa461dddde05fda02afdd4c25d0489187ca42d /src | |
parent | e06381565db6615dfc0d384b76fd332ff93c6299 (diff) | |
download | scala-156137e6006119bf236f3789324783fd1e0ac3c3.tar.gz scala-156137e6006119bf236f3789324783fd1e0ac3c3.tar.bz2 scala-156137e6006119bf236f3789324783fd1e0ac3c3.zip |
when printing an import statement, do not add {...
when printing an import statement, do not add {} around
single identifiers
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/TreePrinters.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreePrinters.scala b/src/compiler/scala/tools/nsc/ast/TreePrinters.scala index 280b005a2c..838b70de44 100644 --- a/src/compiler/scala/tools/nsc/ast/TreePrinters.scala +++ b/src/compiler/scala/tools/nsc/ast/TreePrinters.scala @@ -181,7 +181,11 @@ abstract class TreePrinters { if (s._1 == nme.WILDCARD || s._1 == s._2) s._1.toString() else s._1.toString() + "=>" + s._2.toString() print("import "); print(expr) - print(selectors.map(selectorToString).mkString(".{", ", ", "}")) + print(".") + selectors.map(selectorToString) match { + case List(one) => print(one) + case many => print(many.mkString("{", ", ", "}")) + } case DocDef(comment, definition) => print(comment); println; print(definition) |