make tests green again

This commit is contained in:
Araq 2019-05-27 15:57:20 +02:00 • committed by Andreas Rumpf
commit 795044ed2b
10 changed files with 18 additions and 36 deletions

View file

@ -45,19 +45,14 @@ var
flip: int
proc newCaseNode(data: string): PCaseNode =
new(result)
if flip == 0:
result.kind = nkStr
result.data = data
result = PCaseNode(kind: nkStr, data: data)
else:
result.kind = nkWhole
result.unused = @["", "abc", "abdc"]
result = PCaseNode(kind: nkWhole, unused: @["", "abc", "abdc"])
flip = 1 - flip
proc newCaseNode(a, b: PCaseNode): PCaseNode =
new(result)
result.kind = nkList
result.sons = @[a, b]
result = PCaseNode(kind: nkList, sons: @[a, b])
proc caseTree(lvl: int = 0): PCaseNode =
if lvl == 3: result = newCaseNode("data item")