mirror of
https://github.com/irmen/prog8.git
synced 2024-11-20 18:31:51 +00:00
parentheses around binary exprs in source output
This commit is contained in:
parent
3cd32778bb
commit
a51fad3aab
@ -53,12 +53,14 @@ class AstToSourceCode(val output: (text: String) -> Unit, val program: Program):
|
||||
}
|
||||
|
||||
override fun visit(expr: BinaryExpression) {
|
||||
output("(")
|
||||
expr.left.accept(this)
|
||||
if(expr.operator.any { it.isLetter() })
|
||||
output(" ${expr.operator} ")
|
||||
else
|
||||
output(expr.operator)
|
||||
expr.right.accept(this)
|
||||
output(")")
|
||||
}
|
||||
|
||||
override fun visit(directive: Directive) {
|
||||
|
Loading…
Reference in New Issue
Block a user