Skip to content

Instantly share code, notes, and snippets.

@dom96

dom96/error.nim Secret

Created October 10, 2017 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dom96/749aff1749089ace5a79eb796f3eeeff to your computer and use it in GitHub Desktop.
Save dom96/749aff1749089ace5a79eb796f3eeeff to your computer and use it in GitHub Desktop.
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