flaska/benchmark/compiler/utils.mjs

9 lines
215 B
JavaScript
Raw Normal View History

2024-10-22 10:44:53 +00:00
export function printTree(children, indent = 0) {
if (!children.length) return
for (let child of children) {
console.log(child.char.padStart(1 + indent * 2))
printTree(child.children, indent + 1)
}
}