Skip to content

Instantly share code, notes, and snippets.

@dom96

dom96/error.nim Secret

Created October 10, 2017 17:36
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