make tests green again
This commit is contained in:
parent
383147f5cb
commit
795044ed2b
10 changed files with 18 additions and 36 deletions
|
|
@ -13,16 +13,14 @@ type
|
|||
PNode = ref TNode
|
||||
|
||||
proc newLit(x: int): PNode {.exportc: "newLit", dynlib.} =
|
||||
new(result)
|
||||
result.x = x
|
||||
result = PNode(k: nkLit, x: x)
|
||||
|
||||
proc newOp(k: TNodeKind, a, b: PNode): PNode {.exportc: "newOp", dynlib.} =
|
||||
assert a != nil
|
||||
assert b != nil
|
||||
new(result)
|
||||
result = PNode(k: nkSub, a: a, b: b)
|
||||
# now overwrite with the real value:
|
||||
result.k = k
|
||||
result.a = a
|
||||
result.b = b
|
||||
|
||||
proc buildTree(x: int): PNode {.exportc: "buildTree", dynlib.} =
|
||||
result = newOp(nkMul, newOp(nkAdd, newLit(x), newLit(x)), newLit(x))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue