This commit is contained in:
Irmen de Jong 2023-03-22 20:15:24 +01:00
parent 6218c1c00b
commit 266f6ab919

View File

@ -103,6 +103,14 @@ class PtProgram(
children.forEach { transformBinExprToRPN(it, this) }
binaryExpressionsAreRPN = true
// extra check to see that all PtBinaryExpressions have been transformed
fun binExprCheck(node: PtNode) {
if(node is PtBinaryExpression)
throw IllegalArgumentException("still got binexpr $node ${node.position}")
node.children.forEach { binExprCheck(it) }
}
binExprCheck(this)
}
}