diff options
author | liu fengyun <liu@fengy.me> | 2017-02-01 11:38:18 +0100 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2017-02-02 10:48:16 +0100 |
commit | eec72c46f2f63f682c80a8c6afe428e5dc470b30 (patch) | |
tree | 8c6efaeb282abaf3510b9d72b3973249bb6a651b /compiler/src | |
parent | af7fdb32df34b352bf39f01a26653b169e0d55cf (diff) | |
download | dotty-eec72c46f2f63f682c80a8c6afe428e5dc470b30.tar.gz dotty-eec72c46f2f63f682c80a8c6afe428e5dc470b30.tar.bz2 dotty-eec72c46f2f63f682c80a8c6afe428e5dc470b30.zip |
avoid using macro-based StringContext.f to ease bootstrap
Diffstat (limited to 'compiler/src')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala index 0dc8d8fea..fb37c9e7d 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala @@ -31,8 +31,10 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) { def nameRefToString(ref: NameRef): String = nameToString(tastyName(ref)) def printNames() = - for ((name, idx) <- tastyName.contents.zipWithIndex) - println(f"$idx%4d: " + nameToString(name)) + for ((name, idx) <- tastyName.contents.zipWithIndex) { + val index = "%4d: ".format(idx) + println(index + nameToString(name)) + } def printContents(): Unit = { println("Names:") @@ -47,7 +49,10 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) { def unpickle(reader: TastyReader, tastyName: TastyName.Table): Unit = { import reader._ var indent = 0 - def newLine() = print(f"\n ${index(currentAddr) - index(startAddr)}%5d:" + " " * indent) + def newLine() = { + val length = "%5d:".format(index(currentAddr) - index(startAddr)) + print(s"\n $length" + " " * indent) + } def printNat() = print(" " + readNat()) def printName() = { val idx = readNat() |