Skip to content

Commit 360e0d7

Browse files
author
Tobias Bordenca
committed
Apply suggested changes
- Change Tasty -> TASTy as language alias - Override backendPhases instead of phases - Fix inefficient string concat in StringBuilder call - Fix printNat using Yellow directly instead of treeColor preventing override
1 parent 53d89a5 commit 360e0d7

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) {
2323
def printNames(): Unit =
2424
for ((name, idx) <- nameAtRef.contents.zipWithIndex) {
2525
val index = nameColor("%4d".format(idx))
26-
sb.append(index + ": " + nameToString(name) + "\n")
26+
sb.append(index).append(": ").append(nameToString(name)).append("\n")
2727
}
2828

2929
def printContents(): String = {
@@ -60,15 +60,15 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) {
6060
val length = treeColor("%5d".format(index(currentAddr) - index(startAddr)))
6161
sb.append(s"\n $length:" + " " * indent)
6262
}
63-
def printNat() = sb.append(Yellow(" " + readNat()).show)
63+
def printNat() = sb.append(treeColor(" " + readNat()))
6464
def printName() = {
6565
val idx = readNat()
6666
sb.append(nameColor(" " + idx + " [" + nameRefToString(NameRef(idx)) + "]"))
6767
}
6868
def printTree(): Unit = {
6969
newLine()
7070
val tag = readByte()
71-
sb.append(" ");sb.append(astTagToString(tag))
71+
sb.append(" ").append(astTagToString(tag))
7272
indent += 2
7373
if (tag >= firstLengthTreeTag) {
7474
val len = readNat()

compiler/src/dotty/tools/dotc/decompiler/PartialTASTYDecompiler.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ import dotty.tools.dotc.core.Phases.Phase
77
* on the CompilationUnits
88
*/
99
class PartialTASTYDecompiler extends TASTYDecompiler {
10-
override def phases: List[List[Phase]] =
11-
frontendPhases ::: picklerPhases ::: transformPhases
10+
override protected def backendPhases: List[List[Phase]] = Nil
1211
}

vscode-dotty/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
".tasty"
4646
],
4747
"aliases": [
48-
"Tasty"
48+
"TASTy"
4949
]
5050
}
5151
],

0 commit comments

Comments
 (0)