diff options
author | Martin Odersky <odersky@gmail.com> | 2013-03-20 17:39:32 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-03-20 17:39:32 +0100 |
commit | 5ac2104e688409e24785cfe62cdc7e8ef0bc6428 (patch) | |
tree | 0d48205fa5b50c25e240d77d4fb0e26c4b6c9b36 /src/dotty/tools/dotc/core/Decorators.scala | |
parent | 53e0a8a9227820e47e33f1e0b1d91819aec917c4 (diff) | |
download | dotty-5ac2104e688409e24785cfe62cdc7e8ef0bc6428.tar.gz dotty-5ac2104e688409e24785cfe62cdc7e8ef0bc6428.tar.bz2 dotty-5ac2104e688409e24785cfe62cdc7e8ef0bc6428.zip |
Pretty-printing improvements.
Diffstat (limited to 'src/dotty/tools/dotc/core/Decorators.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Decorators.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Decorators.scala b/src/dotty/tools/dotc/core/Decorators.scala index dd93b216c..2d6526c26 100644 --- a/src/dotty/tools/dotc/core/Decorators.scala +++ b/src/dotty/tools/dotc/core/Decorators.scala @@ -3,7 +3,7 @@ package core import annotation.tailrec import Symbols._ -import Contexts._, Names._, Phases._ +import Contexts._, Names._, Phases._, util.Texts._ /** This object provides useful implicit decorators for types defined elsewhere */ object Decorators { @@ -71,6 +71,10 @@ object Decorators { } } + implicit class TextToString(val text: Text) extends AnyVal { + def show(implicit ctx: Context) = text.mkString(ctx.settings.pageWidth.value) + } + /** Implements a test whether a list of strings representing phases contains * a given phase. The test returns true if the given phase starts with * one of the names in the list of strings. |