8000 Printer improvements to fuse JS emitting and printing by gzm0 · Pull Request #4920 · scala-js/scala-js · GitHub
[go: up one dir, main page]

Skip to content

Printer improvements to fuse JS emitting and printing #4920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 28, 2024
Prev Previous commit
Next Next commit
Simplify printTopLevelTree in JS printer
Because it does not need to flatten blocks anymore, we can simply
print it as a statement and add a trailing newline.
  • Loading branch information
gzm0 committed Jan 28, 2024
commit 135932afa2601f9f2b914c1fdea806f4d3903c25
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,8 @@ object Printers {
}

def printTopLevelTree(tree: Tree): Unit = {
tree match {
case Skip() =>
// do not print anything
case tree: Block =>
var rest = tree.stats
while (rest.nonEmpty) {
printTopLevelTree(rest.head)
rest = rest.tail
}
case _ =>
printStat(tree)
println()
}
printStat(tree)
println()
}

protected def printRow(ts: List[Tree], start: Char, end: Char): Unit = {
Expand Down
0