Better pretty printing. scrolling in the textEditor
This commit is contained in:
parent
f1ff6c29d6
commit
f54b8ca65e
3 changed files with 36 additions and 11 deletions
|
|
@ -207,7 +207,8 @@ export function prettyPrint(ast: AST, indent = 0): string {
|
|||
return `(${func} ${args})`
|
||||
|
||||
case 'let':
|
||||
return `${ast.name} = ${prettyPrint(ast.value, indent + 1)};\n${i}${prettyPrint(ast.body, indent)}`
|
||||
const sep = indent === 0 ? '\n\n' : '\n';
|
||||
return `${ast.name} = ${prettyPrint(ast.value, indent + 1)};${sep}${i}${prettyPrint(ast.body, indent)}`
|
||||
|
||||
case 'list': {
|
||||
const elems = ast.elements.map(e => prettyPrint(e, indent + 1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue