-
-
Save dom96/749aff1749089ace5a79eb796f3eeeff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc nest(this: Expression, newExpr: Expression) = | |
doAssert this.kind in {OR, AND, XOR} | |
if this.left.isNil: | |
this.left = newExpr | |
elif this.right.isNil: | |
this.right = newExpr | |
else: | |
let temp = this.right | |
this.right = Expression(kind: this.kind, left: temp, right: newExpr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment