aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/tasty
diff options
context:
space:
mode:
authorliu fengyun <liufengyunchina@gmail.com>2017-02-02 11:08:42 +0100
committerGitHub <noreply@github.com>2017-02-02 11:08:42 +0100
commitb45aad5da773dddfc8c449a85d5b6d6a21d0a071 (patch)
tree7a6fc95eddc23c9faeb1501618468e8bde7b3694 /compiler/src/dotty/tools/dotc/core/tasty
parent1bbc632868695c061a3a7fd5de7abc0b4dd25636 (diff)
parenteec72c46f2f63f682c80a8c6afe428e5dc470b30 (diff)
downloaddotty-b45aad5da773dddfc8c449a85d5b6d6a21d0a071.tar.gz
dotty-b45aad5da773dddfc8c449a85d5b6d6a21d0a071.tar.bz2
dotty-b45aad5da773dddfc8c449a85d5b6d6a21d0a071.zip
Merge pull request #1923 from dotty-staging/f-interpolator
avoid using macro-based StringContext.f to ease bootstrap
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/tasty')
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala11
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()