From 72cd3bedb5005c1ec815e20a6c0f119f09af5aa4 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:40:11 +0800 Subject: [PATCH] nifbuilder: don't add a space for unchanged lineinfo (#330) --- src/lib/nifbuilder.nim | 4 +- tests/nimony/basics/t2.nif | 14 +-- tests/nimony/basics/tbinarytree.nif | 2 +- tests/nimony/basics/tbool.nif | 36 +++---- tests/nimony/basics/tcstring.nif | 16 +-- tests/nimony/basics/tdefinedarg.nif | 4 +- tests/nimony/basics/tdistinct.nif | 26 ++--- tests/nimony/basics/tenumsizes.nif | 114 +++++++++++----------- tests/nimony/basics/tfib2.nif | 32 +++--- tests/nimony/basics/tforloop.nif | 18 ++-- tests/nimony/basics/tgeneric_obj.nif | 46 ++++----- tests/nimony/basics/timportfromexcept.nif | 10 +- tests/nimony/basics/tsetter.nif | 6 +- tests/nimony/basics/ttemplate.nif | 16 +-- tests/nimony/basics/tvarargs.nif | 52 +++++----- tests/nimony/basics/twhen.nif | 12 +-- tests/nimony/sysbasics/tdefault.nif | 60 ++++++------ tests/nimony/sysbasics/tdollar.nif | 30 +++--- tests/nimony/sysbasics/thooks.nif | 48 ++++----- 19 files changed, 274 insertions(+), 272 deletions(-) diff --git a/src/lib/nifbuilder.nim b/src/lib/nifbuilder.nim index afc8c39e..34a90c2a 100644 --- a/src/lib/nifbuilder.nim +++ b/src/lib/nifbuilder.nim @@ -213,7 +213,6 @@ template addLineIgnoreZero*(b: var string; x: int32) = addLine b, x proc addLineInfo*(b: var Builder; col, line: int32; file = "") = - addSep b var format = LineInfoNone if col != 0'i32: format = LineInfoCol @@ -224,12 +223,15 @@ proc addLineInfo*(b: var Builder; col, line: int32; file = "") = drainPending b case format of LineInfoCol: + addSep b b.buf.addLine col of LineInfoColLine: + addSep b b.buf.addLineIgnoreZero col b.buf.add ',' b.buf.addLine line of LineInfoFile: + addSep b b.buf.addLineIgnoreZero col b.buf.add ',' b.buf.addLineIgnoreZero line diff --git a/tests/nimony/basics/t2.nif b/tests/nimony/basics/t2.nif index 603c636a..0377312e 100644 --- a/tests/nimony/basics/t2.nif +++ b/tests/nimony/basics/t2.nif @@ -1,18 +1,18 @@ (.nif24) ,2,tests/nimony/basics/t2.nim(stmts 2,1 - (type :int.0.t277k7ei1 + (type :int.0.t277k7ei1 (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,3 - (type :float.0.t277k7ei1 + (type :float.0.t277k7ei1 (f +64) . 7 (pragmas 2 (magic 7 Float)) .) 2,4 - (type :string.0.t277k7ei1 + (type :string.0.t277k7ei1 (string) . 8 (pragmas 2 (magic 7 String)) .) ,7 - (proc 5 :\2B.0.t277k7ei1 + (proc 5 :\2B.0.t277k7ei1 (add -3) . . 9 (params 1 (param :x.0 . . ~8,~6 @@ -53,9 +53,9 @@ (param :x.2 . . ~14,~17 (i -1) .)) 2,~17 (i -1) . . 31 - (stmts + (stmts (result :result.1 . . ~29,~17 - (i -1) .) - (asgn result.1 + (i -1) .) + (asgn result.1 (expr x.2)) ~31 (ret result.1)))) \ No newline at end of file diff --git a/tests/nimony/basics/tbinarytree.nif b/tests/nimony/basics/tbinarytree.nif index 0ade2d1c..c8e448df 100644 --- a/tests/nimony/basics/tbinarytree.nif +++ b/tests/nimony/basics/tbinarytree.nif @@ -1,6 +1,6 @@ (.nif24) ,1,tests/nimony/basics/tbinarytree.nim(stmts 5 - (type :int.0.tbivahh0m + (type :int.0.tbivahh0m (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 10,3 diff --git a/tests/nimony/basics/tbool.nif b/tests/nimony/basics/tbool.nif index 8e2609a0..93866e1c 100644 --- a/tests/nimony/basics/tbool.nif +++ b/tests/nimony/basics/tbool.nif @@ -1,37 +1,37 @@ (.nif24) ,1,tests/nimony/basics/tbool.nim(stmts 26 - (type ~21 :bool.0.tbojn1uzv + (type ~21 :bool.0.tbojn1uzv (bool) . ~16 (pragmas 2 (magic 7 Bool)) 2 (enum (u +8) ~18,1 - (efld ~8 :false.0.tbojn1uzv - (false) . - (bool) + (efld ~8 :false.0.tbojn1uzv + (false) . + (bool) (tup +0 "false")) ~8,1 - (efld ~7 :true.0.tbojn1uzv - (true) . - (bool) + (efld ~7 :true.0.tbojn1uzv + (true) . + (bool) (tup +1 "true")))) 5 - (proc :dollar`.bool.0.tbojn1uzv x . . - (params + (proc :dollar`.bool.0.tbojn1uzv x . . + (params (param :e.0 . . 21 (bool) .)) - (string) . . + (string) . . (stmts 23 (result :result.0 . . (string) .) 23 (case e.0 ~18,1 - (of - (set - (false)) - (stmts + (of + (set + (false)) + (stmts (ret "false"))) ~8,1 - (of - (set - (true)) - (stmts + (of + (set + (true)) + (stmts (ret "true")))) (ret result.0))) 4,3 (let :x.0.tbojn1uzv . . 22,~3 diff --git a/tests/nimony/basics/tcstring.nif b/tests/nimony/basics/tcstring.nif index 367d19cd..7f0082bc 100644 --- a/tests/nimony/basics/tcstring.nif +++ b/tests/nimony/basics/tcstring.nif @@ -1,22 +1,22 @@ (.nif24) ,2,tests/nimony/basics/tcstring.nim(stmts 2,1 - (type :int.0.tcs1re56a + (type :int.0.tcs1re56a (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,2 - (type :bool.0.tcs1re56a + (type :bool.0.tcs1re56a (bool) . 6 (pragmas 2 (magic 7 Bool)) .) 2,4 - (type :cstring.0.tcs1re56a + (type :cstring.0.tcs1re56a (cstring) . 9 (pragmas 2 (magic 7 Cstring)) .) 2,5 - (type :pointer.0.tcs1re56a + (type :pointer.0.tcs1re56a (pointer) . 9 (pragmas 2 (magic 7 Pointer)) .) ,8 - (proc 5 :\2B.0.tcs1re56a + (proc 5 :\2B.0.tcs1re56a (add -3) . . 9 (params 1 (param :x.0 . . ~8,~7 @@ -26,7 +26,7 @@ (i -1) 26 (pragmas 2 (magic 7 "AddI")) . .) ,9 - (proc 5 :\2D.0.tcs1re56a + (proc 5 :\2D.0.tcs1re56a (sub -3) . . 9 (params 1 (param :x.1 . . ~8,~8 @@ -36,7 +36,7 @@ (i -1) 26 (pragmas 2 (magic 7 "SubI")) . .) ,11 - (proc 5 :<=.0.tcs1re56a + (proc 5 :<=.0.tcs1re56a (le -3) . . 10 (params 1 (param :x.2 . . ~9,~10 @@ -56,7 +56,7 @@ (const :myconst.0.tcs1re56a . . ,~14 (cstring) 17 (conv ~17,~14 - (cstring) + (cstring) (suf "abc" "R"))) 4,20 (var :zz.0.tcs1re56a . . ~2,~16 (cstring) diff --git a/tests/nimony/basics/tdefinedarg.nif b/tests/nimony/basics/tdefinedarg.nif index 248695d3..1c80f2b2 100644 --- a/tests/nimony/basics/tdefinedarg.nif +++ b/tests/nimony/basics/tdefinedarg.nif @@ -1,10 +1,10 @@ (.nif24) ,1,tests/nimony/basics/tdefinedarg.nim(stmts 5 - (type :untyped.0.tdetxkbxo + (type :untyped.0.tdetxkbxo (untyped) . 9 (pragmas 2 (magic 7 Expr)) .) ,2 - (proc 5 :defined.0.tdetxkbxo + (proc 5 :defined.0.tdetxkbxo (defined) . . 12 (params 1 (param :x.0 . . ~8,~2 diff --git a/tests/nimony/basics/tdistinct.nif b/tests/nimony/basics/tdistinct.nif index f790f845..1f6e4b8b 100644 --- a/tests/nimony/basics/tdistinct.nif +++ b/tests/nimony/basics/tdistinct.nif @@ -1,26 +1,26 @@ (.nif24) ,2,tests/nimony/basics/tdistinct.nim(stmts 2,1 - (type :int.0.tdikoa9tc1 + (type :int.0.tdikoa9tc1 (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,2 - (type :bool.0.tdikoa9tc1 + (type :bool.0.tdikoa9tc1 (bool) . 6 (pragmas 2 (magic 7 Bool)) .) 2,3 - (type :char.0.tdikoa9tc1 + (type :char.0.tdikoa9tc1 (c +8) . 6 (pragmas 2 (magic 7 Char)) .) 2,4 - (type :string.0.tdikoa9tc1 + (type :string.0.tdikoa9tc1 (string) . 8 (pragmas 2 (magic 7 String)) .) 2,6 - (type :int8.0.tdikoa9tc1 + (type :int8.0.tdikoa9tc1 (i +8) . 6 (pragmas 2 (magic 7 Int8)) .) ,8 - (proc 5 :\2B.0.tdikoa9tc1 + (proc 5 :\2B.0.tdikoa9tc1 (add -3) . . 9 (params 1 (param :x.0 . . ~8,~7 @@ -30,7 +30,7 @@ (i -1) 26 (pragmas 2 (magic 7 "AddI")) . .) ,9 - (proc 5 :\2D.0.tdikoa9tc1 + (proc 5 :\2D.0.tdikoa9tc1 (sub -3) . . 9 (params 1 (param :x.1 . . ~8,~8 @@ -40,7 +40,7 @@ (i -1) 26 (pragmas 2 (magic 7 "SubI")) . .) ,11 - (proc 5 :<=.0.tdikoa9tc1 + (proc 5 :<=.0.tdikoa9tc1 (le -3) . . 10 (params 1 (param :x.2 . . ~9,~10 @@ -59,13 +59,13 @@ (param :y.3 . . 3 VarId.0.tdikoa9tc1 .)) 15 VarId.0.tdikoa9tc1 30 (pragmas 2 (borrow)) . 9 - (stmts - (ret - (dconv 6 VarId.0.tdikoa9tc1 + (stmts + (ret + (dconv 6 VarId.0.tdikoa9tc1 (add ~7,~16 - (i -1) + (i -1) (dconv ~7,~16 - (i -1) x.3) + (i -1) x.3) (dconv ~7,~16 (i -1) y.3)))))) 4,24 (var :x.0.tdikoa9tc1 . . 3 VarId.0.tdikoa9tc1 .) 2,26 diff --git a/tests/nimony/basics/tenumsizes.nif b/tests/nimony/basics/tenumsizes.nif index b8a6732e..35820a42 100644 --- a/tests/nimony/basics/tenumsizes.nif +++ b/tests/nimony/basics/tenumsizes.nif @@ -3,108 +3,108 @@ (type ~2 :A.0.ten11nvsp1 . . . 2 (enum (u +8) ~7,1 - (efld :a0.0.ten11nvsp1 . . A.0.ten11nvsp1 + (efld :a0.0.ten11nvsp1 . . A.0.ten11nvsp1 (tup +0 "a0")) ~3,1 - (efld :a1.0.ten11nvsp1 . . A.0.ten11nvsp1 + (efld :a1.0.ten11nvsp1 . . A.0.ten11nvsp1 (tup +1 "a1")) 1,1 - (efld :a2.0.ten11nvsp1 . . A.0.ten11nvsp1 + (efld :a2.0.ten11nvsp1 . . A.0.ten11nvsp1 (tup +2 "a2")) 5,1 - (efld :a3.0.ten11nvsp1 . . A.0.ten11nvsp1 + (efld :a3.0.ten11nvsp1 . . A.0.ten11nvsp1 (tup +3 "a3")))) 5 - (proc :dollar`.A.0.ten11nvsp1 x . . - (params + (proc :dollar`.A.0.ten11nvsp1 x . . + (params (param :e.0 . . A.0.ten11nvsp1 .)) - (string) . . + (string) . . (stmts 4 (result :result.0 . . (string) .) 4 (case e.0 ~7,1 - (of - (set a0.0.ten11nvsp1) - (stmts + (of + (set a0.0.ten11nvsp1) + (stmts (ret "a0"))) ~3,1 - (of - (set a1.0.ten11nvsp1) - (stmts + (of + (set a1.0.ten11nvsp1) + (stmts (ret "a1"))) 1,1 - (of - (set a2.0.ten11nvsp1) - (stmts + (of + (set a2.0.ten11nvsp1) + (stmts (ret "a2"))) 5,1 - (of - (set a3.0.ten11nvsp1) - (stmts + (of + (set a3.0.ten11nvsp1) + (stmts (ret "a3")))) (ret result.0))) 7,2 (type ~2 :B.0.ten11nvsp1 . . . 2 (onum (i +32) ~2,1 - (efld ~5 :b0.0.ten11nvsp1 . . B.0.ten11nvsp1 + (efld ~5 :b0.0.ten11nvsp1 . . B.0.ten11nvsp1 (tup -1 "b0")) 2,1 - (efld :b1.0.ten11nvsp1 . . B.0.ten11nvsp1 + (efld :b1.0.ten11nvsp1 . . B.0.ten11nvsp1 (tup +0 "b1")) 6,1 - (efld :b2.0.ten11nvsp1 . . B.0.ten11nvsp1 + (efld :b2.0.ten11nvsp1 . . B.0.ten11nvsp1 (tup +1 "b2")) 15,1 - (efld ~5 :b3.0.ten11nvsp1 . . B.0.ten11nvsp1 + (efld ~5 :b3.0.ten11nvsp1 . . B.0.ten11nvsp1 (tup +5 "b3")))) 5,2 - (proc :dollar`.B.0.ten11nvsp1 x . . - (params + (proc :dollar`.B.0.ten11nvsp1 x . . + (params (param :e.1 . . B.0.ten11nvsp1 .)) - (string) . . + (string) . . (stmts 4 (result :result.1 . . (string) .) 4 (case e.1 ~2,1 - (of - (set ~5 b0.0.ten11nvsp1) - (stmts + (of + (set ~5 b0.0.ten11nvsp1) + (stmts (ret "b0"))) 2,1 - (of - (set b1.0.ten11nvsp1) - (stmts + (of + (set b1.0.ten11nvsp1) + (stmts (ret "b1"))) 6,1 - (of - (set b2.0.ten11nvsp1) - (stmts + (of + (set b2.0.ten11nvsp1) + (stmts (ret "b2"))) 15,1 - (of - (set ~5 b3.0.ten11nvsp1) - (stmts + (of + (set ~5 b3.0.ten11nvsp1) + (stmts (ret "b3")))) (ret result.1))) 7,4 (type ~2 :C.0.ten11nvsp1 . . . 2 (onum (u +16) ~7,1 - (efld :c0.0.ten11nvsp1 . . C.0.ten11nvsp1 + (efld :c0.0.ten11nvsp1 . . C.0.ten11nvsp1 (tup +0 "c0")) ~3,1 - (efld :c1.0.ten11nvsp1 . . C.0.ten11nvsp1 + (efld :c1.0.ten11nvsp1 . . C.0.ten11nvsp1 (tup +1 "c1")) 6,1 - (efld ~5 :c2.0.ten11nvsp1 . . C.0.ten11nvsp1 + (efld ~5 :c2.0.ten11nvsp1 . . C.0.ten11nvsp1 (tup +30000 "c2")) 14,1 - (efld :c3.0.ten11nvsp1 . . C.0.ten11nvsp1 + (efld :c3.0.ten11nvsp1 . . C.0.ten11nvsp1 (tup +30001 "c3")))) 5,4 - (proc :dollar`.C.0.ten11nvsp1 x . . - (params + (proc :dollar`.C.0.ten11nvsp1 x . . + (params (param :e.2 . . C.0.ten11nvsp1 .)) - (string) . . + (string) . . (stmts 4 (result :result.2 . . (string) .) 4 (case e.2 ~7,1 - (of - (set c0.0.ten11nvsp1) - (stmts + (of + (set c0.0.ten11nvsp1) + (stmts (ret "c0"))) ~3,1 - (of - (set c1.0.ten11nvsp1) - (stmts + (of + (set c1.0.ten11nvsp1) + (stmts (ret "c1"))) 6,1 - (of - (set ~5 c2.0.ten11nvsp1) - (stmts + (of + (set ~5 c2.0.ten11nvsp1) + (stmts (ret "c2"))) 14,1 - (of - (set c3.0.ten11nvsp1) - (stmts + (of + (set c3.0.ten11nvsp1) + (stmts (ret "c3")))) (ret result.2)))) \ No newline at end of file diff --git a/tests/nimony/basics/tfib2.nif b/tests/nimony/basics/tfib2.nif index 3fd32d2b..2a915abd 100644 --- a/tests/nimony/basics/tfib2.nif +++ b/tests/nimony/basics/tfib2.nif @@ -1,18 +1,18 @@ (.nif24) ,2,tests/nimony/basics/tfib2.nim(stmts 2,1 - (type :int.0.tfie0imm3 + (type :int.0.tfie0imm3 (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,2 - (type :bool.0.tfie0imm3 + (type :bool.0.tfie0imm3 (bool) . 6 (pragmas 2 (magic 7 Bool)) .) 2,3 - (type :float.0.tfie0imm3 + (type :float.0.tfie0imm3 (f +64) . 7 (pragmas 2 (magic 7 Float)) .) ,5 - (proc 5 :\2B.0.tfie0imm3 + (proc 5 :\2B.0.tfie0imm3 (add -3) . . 9 (params 1 (param :x.0 . . ~8,~4 @@ -22,7 +22,7 @@ (i -1) 26 (pragmas 2 (magic 7 "AddI")) . .) ,6 - (proc 5 :\2D.0.tfie0imm3 + (proc 5 :\2D.0.tfie0imm3 (sub -3) . . 9 (params 1 (param :x.1 . . ~8,~5 @@ -32,7 +32,7 @@ (i -1) 26 (pragmas 2 (magic 7 "SubI")) . .) ,8 - (proc 5 :<=.0.tfie0imm3 + (proc 5 :<=.0.tfie0imm3 (le -3) . . 10 (params 1 (param :x.2 . . ~9,~7 @@ -42,7 +42,7 @@ (bool) 28 (pragmas 2 (magic 7 "LeI")) . .) ,10 - (proc 5 :\2B.1.tfie0imm3 + (proc 5 :\2B.1.tfie0imm3 (add -3) . . 9 (params 1 (param :x.3 . . ~8,~7 @@ -52,7 +52,7 @@ (f +64) 30 (pragmas 2 (magic 7 "AddF64")) . .) ,11 - (proc 5 :\2D.1.tfie0imm3 + (proc 5 :\2D.1.tfie0imm3 (sub -3) . . 9 (params 1 (param :x.4 . . ~8,~8 @@ -62,7 +62,7 @@ (f +64) 30 (pragmas 2 (magic 7 "SubF64")) . .) ,13 - (proc 5 :<=.1.tfie0imm3 + (proc 5 :<=.1.tfie0imm3 (le -3) . . 10 (params 1 (param :x.5 . . ~9,~10 @@ -73,9 +73,9 @@ (pragmas 2 (magic 7 "LeF64")) . .) 10,17 (type ~8 :Fibable.0.tfie0imm3 . . . 2 - (concept . . + (concept . . (typevar :Self.0.tfie0imm3 . . . .) ~8,1 - (stmts + (stmts (proc 5 :<=.0 . . . 9 (params 1 (param :a.0 . . 6 Self.0.tfie0imm3 .) 4 @@ -94,8 +94,8 @@ (typevar :T.0.tfie0imm3 . . 3 Fibable.0.tfie0imm3 .)) 20 (params 1 (param :a.1 . . 3 T.0.tfie0imm3 .)) 8 T.0.tfie0imm3 . . 2,1 - (stmts - (result :result.0 . . 22,~1 T.0.tfie0imm3 .) + (stmts + (result :result.0 . . 22,~1 T.0.tfie0imm3 .) (if 3 (elif 2 (infix <= ~2 a.1 3 +2) ~1,1 @@ -114,16 +114,16 @@ (call ~3 fib.1.tfie0imm3 1 +8)) ,29 (discard 16 (call ~8 fib.1.tfie0imm3 1 +8)) 11,28 - (proc :fib.1.tfie0imm3 . ~11,~6 . + (proc :fib.1.tfie0imm3 . ~11,~6 . (at fib.0.tfie0imm3 (i -1)) 9,~6 (params 1 (param :a.3 . . (i -1) .)) (i -1) ~11,~6 . ~11,~6 . ~9,~5 - (stmts + (stmts (result :result.1 . . - (i -1) .) + (i -1) .) (if 3 (elif 2 (le diff --git a/tests/nimony/basics/tforloop.nif b/tests/nimony/basics/tforloop.nif index 032cd6e8..03e375df 100644 --- a/tests/nimony/basics/tforloop.nif +++ b/tests/nimony/basics/tforloop.nif @@ -1,14 +1,14 @@ (.nif24) ,2,tests/nimony/basics/tforloop.nim(stmts 2,1 - (type :int.0.tfoaf4sx41 + (type :int.0.tfoaf4sx41 (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,2 - (type :bool.0.tfoaf4sx41 + (type :bool.0.tfoaf4sx41 (bool) . 6 (pragmas 2 (magic 7 Bool)) .) ,4 - (proc 5 :\2B.0.tfoaf4sx41 + (proc 5 :\2B.0.tfoaf4sx41 (add -3) . . 9 (params 1 (param :x.0 . . ~8,~3 @@ -18,7 +18,7 @@ (i -1) 26 (pragmas 2 (magic 7 "AddI")) . .) ,5 - (proc 5 :\2D.0.tfoaf4sx41 + (proc 5 :\2D.0.tfoaf4sx41 (sub -3) . . 9 (params 1 (param :x.1 . . ~8,~4 @@ -28,7 +28,7 @@ (i -1) 26 (pragmas 2 (magic 7 "SubI")) . .) ,7 - (proc 5 :<=.0.tfoaf4sx41 + (proc 5 :<=.0.tfoaf4sx41 (le -3) . . 10 (params 1 (param :x.2 . . ~9,~6 @@ -51,15 +51,15 @@ (while 8 (le ~8,~10 (i -1) ~2 x.3 3 b.0) 2,1 - (stmts + (stmts (yld 6 x.3) 2,1 (asgn ~2 x.3 4 (add ~8,~12 (i -1) ~2 x.3 2 +1)))))) 4,15 (for 20 - (call ~7 countup.0.tfoaf4sx41 1 +0 4 +44) - (unpackflat + (call ~7 countup.0.tfoaf4sx41 1 +0 4 +44) + (unpackflat (let :mycounter.0 . . ~2,~14 (i -1) .)) ~2,1 - (stmts + (stmts (discard 8 mycounter.0)))) \ No newline at end of file diff --git a/tests/nimony/basics/tgeneric_obj.nif b/tests/nimony/basics/tgeneric_obj.nif index e81d225b..adfba12d 100644 --- a/tests/nimony/basics/tgeneric_obj.nif +++ b/tests/nimony/basics/tgeneric_obj.nif @@ -1,28 +1,28 @@ (.nif24) ,2,tests/nimony/basics/tgeneric_obj.nim(stmts 2,1 - (type :int.0.tgekp9q4q1 + (type :int.0.tgekp9q4q1 (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,3 - (type :float.0.tgekp9q4q1 + (type :float.0.tgekp9q4q1 (f +64) . 7 (pragmas 2 (magic 7 Float)) .) 2,4 - (type :string.0.tgekp9q4q1 + (type :string.0.tgekp9q4q1 (string) . 8 (pragmas 2 (magic 7 String)) .) 2,5 - (type :uint8.0.tgekp9q4q1 + (type :uint8.0.tgekp9q4q1 (u +8) . 7 (pragmas 2 (magic 7 UInt8)) .) 2,7 - (type :set.0.tgekp9q4q1 + (type :set.0.tgekp9q4q1 (sett) 4 (typevars 1 (typevar :T.0.tgekp9q4q1 . . . .)) 8 (pragmas 2 (magic 7 Set)) .) 2,8 - (type :array.0.tgekp9q4q1 + (type :array.0.tgekp9q4q1 (array) 7 (typevars 1 (typevar :Index.0.tgekp9q4q1 . . . .) 8 @@ -34,7 +34,7 @@ (u +8)) .) 4,11 (var :myarr.0.tgekp9q4q1 . . 12 (array ~14,~10 - (i -1) + (i -1) (rangetype (i -1) +0 +2)) .) 4,12 (let :u8.0.tgekp9q4q1 . . @@ -44,7 +44,7 @@ (set 1 (suf +1u "u8") 7 u8.0.tgekp9q4q1 11 (suf +5u "u8") 17 - (range + (range (suf +7u "u8") 6 (suf +9u "u8")))) 6,14 (asgn ~6 myarr.0.tgekp9q4q1 2 @@ -60,7 +60,7 @@ (dot ~6 myglob.0.tgekp9q4q1 x.1.tgekp9q4q1 +0) 2 +56) 8,25 (asgn ~3 (dot ~5 other.0.tgekp9q4q1 x.2.tgekp9q4q1 +0) 2 +79.0) ,27 - (proc 5 :\2B.0.tgekp9q4q1 + (proc 5 :\2B.0.tgekp9q4q1 (add -3) . . 9 (params 1 (param :x.0 . . ~8,~26 @@ -72,7 +72,7 @@ (magic 7 "AddI")) . .) ,29 (template 9 :foobar.0.tgekp9q4q1 . . . 15 (params) . . . 2,1 - (stmts + (stmts (break .))) ,32 (proc 5 :foo.0.tgekp9q4q1 . . . 8 (params 1 @@ -119,14 +119,14 @@ (param :a.0 . . 3 T.5.tgekp9q4q1 .) 7 (param :b.0 . . 3 U.1.tgekp9q4q1 .)) 20 (at ~6 HSlice.0.tgekp9q4q1 1 T.5.tgekp9q4q1 4 U.1.tgekp9q4q1) . . 45 - (stmts + (stmts (result :result.1 . . ~25 - (at ~6 HSlice.0.tgekp9q4q1 1 T.5.tgekp9q4q1 4 U.1.tgekp9q4q1) .) + (at ~6 HSlice.0.tgekp9q4q1 1 T.5.tgekp9q4q1 4 U.1.tgekp9q4q1) .) (discard .) ~45 (ret result.1))) 4,50 (var :myarr2.0.tgekp9q4q1 . . 12,~39 (array ~14,~10 - (i -1) + (i -1) (rangetype (i -1) +0 +2)) 27 myarr.0.tgekp9q4q1) 7,51 (asgn ~7 myarr2.0.tgekp9q4q1 2 @@ -138,7 +138,7 @@ (params 1 (param :x.2 . . 8 (array 4 T.6.tgekp9q4q1 1 I.0.tgekp9q4q1) .)) . . . 33 - (stmts + (stmts (discard .))) 3,54 (call ~3 foo.2.tgekp9q4q1 1 myarr2.0.tgekp9q4q1) ,56 (proc 5 :identity.0.tgekp9q4q1 . . 13 @@ -156,7 +156,7 @@ (ret result.2))) 7,58 (asgn ~7 myarr2.0.tgekp9q4q1 10 (call ~8 identity.1.tgekp9q4q1 1 myarr2.0.tgekp9q4q1)) 19,50 - (proc :\2E..1.tgekp9q4q1 . ~19,~3 . + (proc :\2E..1.tgekp9q4q1 . ~19,~3 . (at \2E..0.tgekp9q4q1 (i -1) (i -1)) ~3,~3 @@ -165,11 +165,11 @@ (i -1) .) 7 (param :b.2 . . (i -1) .)) 1,~3 HSlice.1.tgekp9q4q1 ~19,~3 . ~19,~3 . 26,~3 - (stmts - (result :result.3 . . ~25 HSlice.1.tgekp9q4q1 .) + (stmts + (result :result.3 . . ~25 HSlice.1.tgekp9q4q1 .) (discard .) ~45 (ret result.3))) 3,54 - (proc :foo.2.tgekp9q4q1 . ~3,~1 . + (proc :foo.2.tgekp9q4q1 . ~3,~1 . (at foo.1.tgekp9q4q1 13,~43 (rangetype (i -1) +0 +2) ~1,~53 @@ -180,9 +180,9 @@ (i -1) ~7,~42 (rangetype (i -1) +0 +2)) .)) ~3,~1 . ~3,~1 . ~3,~1 . 30,~1 - (stmts + (stmts (discard .))) 17,58 - (proc :identity.1.tgekp9q4q1 . ~17,~2 . + (proc :identity.1.tgekp9q4q1 . ~17,~2 . (at identity.0.tgekp9q4q1 ~1,~47 (rangetype (i -1) +0 +2) ~15,~57 @@ -205,19 +205,19 @@ (i -1) +0 +2)) .) 7 (asgn ~7 result.4 2 x.8) ~2,~1 (ret result.4))) 19,21 - (type :MyGeneric.1.tgekp9q4q1 . + (type :MyGeneric.1.tgekp9q4q1 . (at MyGeneric.0.tgekp9q4q1 ~17,~20 (i -1)) ~4,~4 . ~2,~4 (object . ~13,1 (fld :x.1.tgekp9q4q1 . . ~2,~17 (i -1) .))) 18,22 - (type :MyGeneric.2.tgekp9q4q1 . + (type :MyGeneric.2.tgekp9q4q1 . (at MyGeneric.0.tgekp9q4q1 ~16,~19 (f +64)) ~3,~5 . ~1,~5 (object . ~13,1 (fld :x.2.tgekp9q4q1 . . ~2,~15 (f +64) .))) 20,47 - (type :HSlice.1.tgekp9q4q1 . + (type :HSlice.1.tgekp9q4q1 . (at HSlice.0.tgekp9q4q1 (i -1) (i -1)) ~4,~5 . ~2,~5 diff --git a/tests/nimony/basics/timportfromexcept.nif b/tests/nimony/basics/timportfromexcept.nif index fe631b15..4bd05df0 100644 --- a/tests/nimony/basics/timportfromexcept.nif +++ b/tests/nimony/basics/timportfromexcept.nif @@ -1,14 +1,14 @@ (.nif24) ,1,tests/nimony/basics/timportfromexcept.nim(stmts 4,4 - (let :allImported.0.timkmpki51 . . + (let :allImported.0.timkmpki51 . . (array 11,~2,tests/nimony/basics/deps/modexcept.nim - (i -1) + (i -1) (rangetype (i -1) +0 +2)) 14 (arr 1 exceptB.0.modq349xg1 10 fromA.0.mod50uygs 17 fromC.0.mod50uygs)) 4,5 - (let :exceptDeclared.0.timkmpki51 . . + (let :exceptDeclared.0.timkmpki51 . . (array - (bool) + (bool) (rangetype (i -1) +0 +2)) 17 (arr @@ -17,7 +17,7 @@ (false))) 4,6 (let :fromDeclared.0.timkmpki51 . . ,~1 (array - (bool) + (bool) (rangetype (i -1) +0 +2)) 15 (arr diff --git a/tests/nimony/basics/tsetter.nif b/tests/nimony/basics/tsetter.nif index 700bedab..9c55b3c1 100644 --- a/tests/nimony/basics/tsetter.nif +++ b/tests/nimony/basics/tsetter.nif @@ -1,6 +1,6 @@ (.nif24) ,1,tests/nimony/basics/tsetter.nim(stmts 5 - (type :int.0.tseyo1t971 + (type :int.0.tseyo1t971 (i -1) . 4 (pragmas 2 (magic 7 Int)) .) 9,2 @@ -11,7 +11,7 @@ (param :x.0 . . 3 Foo.0.tseyo1t971 .) 9 (param :y.0 . . ~15,~4 (i -1) .)) . . . 30 - (stmts + (stmts (discard .))) ,5 (proc 5 :\5B\5D=.0.tseyo1t971 . . . 10 (params 1 @@ -20,7 +20,7 @@ (i -1) .) 17 (param :z.0 . . ~22,~5 (i -1) .)) . . . 37 - (stmts + (stmts (discard .))) 4,7 (var :foo.0.tseyo1t971 . . 5 Foo.0.tseyo1t971 .) ,8 (call bar=.0.tseyo1t971 foo.0.tseyo1t971 10 +123) ,9 diff --git a/tests/nimony/basics/ttemplate.nif b/tests/nimony/basics/ttemplate.nif index 71cd1d49..d350421e 100644 --- a/tests/nimony/basics/ttemplate.nif +++ b/tests/nimony/basics/ttemplate.nif @@ -1,18 +1,18 @@ (.nif24) ,2,tests/nimony/basics/ttemplate.nim(stmts 2,1 - (type :int.0.tte6j7czy + (type :int.0.tte6j7czy (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,3 - (type :float.0.tte6j7czy + (type :float.0.tte6j7czy (f +64) . 7 (pragmas 2 (magic 7 Float)) .) 2,4 - (type :string.0.tte6j7czy + (type :string.0.tte6j7czy (string) . 8 (pragmas 2 (magic 7 String)) .) 2,6 - (type :array.0.tte6j7czy + (type :array.0.tte6j7czy (array) 7 (typevars 1 (typevar :Index.0.tte6j7czy . . . .) 8 @@ -30,7 +30,7 @@ (dot ~6 myglob.0.tte6j7czy x.1.tte6j7czy +0) 2 +56) 8,17 (asgn ~3 (dot ~5 other.0.tte6j7czy x.2.tte6j7czy +0) 2 +79.0) ,19 - (proc 5 :\2B.0.tte6j7czy + (proc 5 :\2B.0.tte6j7czy (add -3) . . 9 (params 1 (param :x.0 . . ~8,~18 @@ -82,7 +82,7 @@ (call ~3 foo.0.tte6j7czy 3 (add (i -1) ~2 +34 1 +56) 8 "xyz")))) 5,32 - (type :uint.0.tte6j7czy + (type :uint.0.tte6j7czy (u -1) . 6 (pragmas 2 (magic 7 UInt)) .) ,34 @@ -100,13 +100,13 @@ (expr 1 (conv ~26,~2 (u -1) ~12,3 val.0.tte6j7czy))) 19,13 - (type :MyGeneric.1.tte6j7czy . + (type :MyGeneric.1.tte6j7czy . (at MyGeneric.0.tte6j7czy ~17,~12 (i -1)) ~4,~4 . ~2,~4 (object . ~13,1 (fld :x.1.tte6j7czy . . ~2,~9 (i -1) .))) 18,14 - (type :MyGeneric.2.tte6j7czy . + (type :MyGeneric.2.tte6j7czy . (at MyGeneric.0.tte6j7czy ~16,~11 (f +64)) ~3,~5 . ~1,~5 (object . ~13,1 diff --git a/tests/nimony/basics/tvarargs.nif b/tests/nimony/basics/tvarargs.nif index 93719f48..617559e2 100644 --- a/tests/nimony/basics/tvarargs.nif +++ b/tests/nimony/basics/tvarargs.nif @@ -1,22 +1,22 @@ (.nif24) ,2,tests/nimony/basics/tvarargs.nim(stmts 2,1 - (type :int.0.tvaktfkwp + (type :int.0.tvaktfkwp (i -1) . 5 (pragmas 2 (magic 7 Int)) .) 2,2 - (type :bool.0.tvaktfkwp + (type :bool.0.tvaktfkwp (bool) . 6 (pragmas 2 (magic 7 Bool)) .) 2,3 - (type :char.0.tvaktfkwp + (type :char.0.tvaktfkwp (c +8) . 6 (pragmas 2 (magic 7 Char)) .) 2,4 - (type :string.0.tvaktfkwp + (type :string.0.tvaktfkwp (string) . 8 (pragmas 2 (magic 7 String)) .) ,6 - (proc 5 :\2B.0.tvaktfkwp + (proc 5 :\2B.0.tvaktfkwp (add -3) . . 9 (params 1 (param :x.0 . . ~8,~5 @@ -26,7 +26,7 @@ (i -1) 26 (pragmas 2 (magic 7 "AddI")) . .) ,7 - (proc 5 :\2D.0.tvaktfkwp + (proc 5 :\2D.0.tvaktfkwp (sub -3) . . 9 (params 1 (param :x.1 . . ~8,~6 @@ -36,7 +36,7 @@ (i -1) 26 (pragmas 2 (magic 7 "SubI")) . .) ,9 - (proc 5 :<=.0.tvaktfkwp + (proc 5 :<=.0.tvaktfkwp (le -3) . . 10 (params 1 (param :x.2 . . ~9,~8 @@ -55,7 +55,7 @@ (mut 4 File.0.tvaktfkwp) .) 14 (param :c.0 . . ~22,~13 (c +8) .)) . . . 35 - (stmts + (stmts (discard .))) ,17 (proc 5 :write.1.tvaktfkwp . . . 10 (params 1 @@ -63,15 +63,15 @@ (mut 4 File.0.tvaktfkwp) .) 14 (param :s.0 . . ~22,~13 (string) .)) . . . 37 - (stmts + (stmts (discard .))) ,19 (cmd write.0.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 14 '\0A') 2,22 - (type :untyped.0.tvaktfkwp + (type :untyped.0.tvaktfkwp (untyped) . 9 (pragmas 2 (magic 7 Expr)) .) ,24 - (iterator 9 :unpack.0.tvaktfkwp + (iterator 9 :unpack.0.tvaktfkwp (unpack) . . 15 (params) 2,~2 (untyped) 27 @@ -79,54 +79,54 @@ (magic 7 Unpack)) . .) ,26 (template 9 :echo.0.tvaktfkwp x . . 14 (params 5 - (param :vanon.0 . . + (param :vanon.0 . . (varargs) .)) . 17 (pragmas 2 (varargs)) . 2,1 (stmts 4 (for 11 - (unpack) - (unpackflat + (unpack) + (unpackflat (let :x.3 . . ~4,~5 (untyped) .)) ~2,1 - (expr - (cmd + (expr + (cmd (ochoice write.0.tvaktfkwp write.1.tvaktfkwp) 6 stdout.0.tvaktfkwp 14 x.3))) ,2 (cmd write.0.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 14 '\0A'))) 4,31 (var :someVar.0.tvaktfkwp . . (string) 10 "") 2,27 (stmts 2,1 - (stmts + (stmts (cmd write.1.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 1,5 "a")) 2,1 - (stmts + (stmts (cmd write.1.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 6,5 someVar.0.tvaktfkwp)) 2,1 - (stmts + (stmts (cmd write.1.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 15,5 "b")) ,2 (cmd write.0.tvaktfkwp 6 - (haddr + (haddr (haddr stdout.0.tvaktfkwp)) 14 '\0A')) 2,27 (stmts 2,1 - (stmts + (stmts (cmd write.1.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 1,7 "xzy")) 2,1 - (stmts + (stmts (cmd write.0.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 8,7 'c')) ,2 (cmd write.0.tvaktfkwp 6 - (haddr + (haddr (haddr stdout.0.tvaktfkwp)) 14 '\0A')) 2,27 (stmts ,2 (cmd write.0.tvaktfkwp 6 - (haddr + (haddr (haddr stdout.0.tvaktfkwp)) 14 '\0A')) 2,27 (stmts 2,1 - (stmts + (stmts (cmd write.1.tvaktfkwp 6 (haddr stdout.0.tvaktfkwp) 1,11 someVar.0.tvaktfkwp)) ,2 (cmd write.0.tvaktfkwp 6 - (haddr + (haddr (haddr stdout.0.tvaktfkwp)) 14 '\0A'))) \ No newline at end of file diff --git a/tests/nimony/basics/twhen.nif b/tests/nimony/basics/twhen.nif index cba3c778..47bb1cbc 100644 --- a/tests/nimony/basics/twhen.nif +++ b/tests/nimony/basics/twhen.nif @@ -1,14 +1,14 @@ (.nif24) ,1,tests/nimony/basics/twhen.nim(stmts 2,3 - (stmts + (stmts (discard 8 "good")) 2,10 - (stmts + (stmts (discard 8 "good")) 2,13 - (stmts + (stmts (discard 8 "good")) 2,20 - (stmts + (stmts (discard 8 "good")) ,28 - (proc 5 :not.0.twh0750pd + (proc 5 :not.0.twh0750pd (not) . . 11 (params 1 (param :x.0 . . 14,~26,tests/nimony/basics/deps/mwhen.nim @@ -16,5 +16,5 @@ (bool) 27 (pragmas 2 (magic 7 Not)) . .) 2,33 - (stmts + (stmts (discard 8 "good"))) \ No newline at end of file diff --git a/tests/nimony/sysbasics/tdefault.nif b/tests/nimony/sysbasics/tdefault.nif index 5217e767..830c3c6a 100644 --- a/tests/nimony/sysbasics/tdefault.nif +++ b/tests/nimony/sysbasics/tdefault.nif @@ -1,5 +1,5 @@ (.nif24) -,1,tests/nimony/sysbasics/tdefault.nim(stmts +,1,tests/nimony/sysbasics/tdefault.nim(stmts (discard 58,706,lib/std/system.nim (expr "")) ,1 (discard 52,681,lib/std/system.nim @@ -13,31 +13,31 @@ (type ~5 :Enum.0.tde837gue . . . 2 (enum (u +8) 5 - (efld :a.0.tde837gue . . Enum.0.tde837gue + (efld :a.0.tde837gue . . Enum.0.tde837gue (tup +0 "a")) 8 - (efld :b.0.tde837gue . . Enum.0.tde837gue + (efld :b.0.tde837gue . . Enum.0.tde837gue (tup +1 "b")) 11 - (efld :c.0.tde837gue . . Enum.0.tde837gue + (efld :c.0.tde837gue . . Enum.0.tde837gue (tup +2 "c")))) 5,4 - (proc :dollar`.Enum.0.tde837gue x . . - (params + (proc :dollar`.Enum.0.tde837gue x . . + (params (param :e.0 . . Enum.0.tde837gue .)) - (string) . . + (string) . . (stmts 7 (result :result.0 . . ~8,40,lib/std/system.nim (string) .) 7 (case e.0 5 - (of - (set a.0.tde837gue) - (stmts + (of + (set a.0.tde837gue) + (stmts (ret "a"))) 8 - (of - (set b.0.tde837gue) - (stmts + (of + (set b.0.tde837gue) + (stmts (ret "b"))) 11 - (of - (set c.0.tde837gue) - (stmts + (of + (set c.0.tde837gue) + (stmts (ret "c")))) (ret result.0))) ,5 (discard 57,703,lib/std/system.nim @@ -54,12 +54,12 @@ (bool) .) 15 (fld :b.1.tde837gue . . 3 Enum.0.tde837gue .)) .))) ,12 (discard 15 - (obj 1 Obj.0.tde837gue + (obj 1 Obj.0.tde837gue (kv x.0.tde837gue 37,670,lib/std/system.nim - (expr +0)) + (expr +0)) (kv y.0.tde837gue 43,694,lib/std/system.nim - (expr "")) - (kv z.0.tde837gue + (expr "")) + (kv z.0.tde837gue (tup 39,666,lib/std/system.nim (expr ~33,~308 (false)) 42,696,lib/std/system.nim @@ -75,12 +75,12 @@ (result :result.1 . . ~2,~9,lib/std/system.nim (i -1) .) 4 (var :data.0 . . 10,~3 Obj.0.tde837gue 10 - (obj ,~3 Obj.0.tde837gue + (obj ,~3 Obj.0.tde837gue (kv x.0.tde837gue 36,667,lib/std/system.nim - (expr +0)) + (expr +0)) (kv y.0.tde837gue 42,691,lib/std/system.nim - (expr "")) - (kv z.0.tde837gue + (expr "")) + (kv z.0.tde837gue (tup 38,663,lib/std/system.nim (expr ~33,~308 (false)) 41,693,lib/std/system.nim @@ -106,7 +106,7 @@ (dot ~6 global.0.tde837gue x.1.tde837gue +0) 1 "123")) 7,28 (asgn ~7 global.0.tde837gue 10 (obj ~5,~5 MyObject.0.tde837gue 2 - (kv ~2 x.1.tde837gue 2 +123) + (kv ~2 x.1.tde837gue 2 +123) (kv y.1.tde837gue 35,654,lib/std/system.nim (expr +0)))) 7,29 (asgn ~7 global.0.tde837gue 10 @@ -118,7 +118,7 @@ (stmts 7 (asgn ~7 global.0.tde837gue 10 (obj ~7,~8 MyObject.0.tde837gue 2 - (kv ~2 x.1.tde837gue 2 +123) + (kv ~2 x.1.tde837gue 2 +123) (kv y.1.tde837gue 33,651,lib/std/system.nim (expr +0)))) 7,1 (asgn ~7 global.0.tde837gue 10 @@ -128,7 +128,7 @@ (stmts 7 (asgn ~7 global.0.tde837gue 10 (obj ~7,~8 MyObject.0.tde837gue 2 - (kv ~2 x.1.tde837gue 2 +123) + (kv ~2 x.1.tde837gue 2 +123) (kv y.1.tde837gue 33,651,lib/std/system.nim (expr +0)))) 7,1 (asgn ~7 global.0.tde837gue 10 @@ -164,7 +164,7 @@ (ret result.2))) ,45 (discard 19 (call ~11 genericProc.1.tde837gue 1 +456)) 19,45 - (proc :genericProc.1.tde837gue . ~19,~4 . + (proc :genericProc.1.tde837gue . ~19,~4 . (at genericProc.0.tde837gue (i -1)) ,~4 (params 1 @@ -173,13 +173,13 @@ (stmts 7 (result :result.3 . . 9,~1 GenericObj.1.tde837gue .) 7 (asgn ~7 result.3 15 - (obj ~1,~4 GenericObj.1.tde837gue + (obj ~1,~4 GenericObj.1.tde837gue (kv x.3.tde837gue 28,640,lib/std/system.nim (expr +0)))) 9,1 (asgn ~3 (dot ~6 result.3 x.3.tde837gue +0) 2 x.4) ~2,~1 (ret result.3))) 23,38 - (type :GenericObj.1.tde837gue . + (type :GenericObj.1.tde837gue . (at GenericObj.0.tde837gue ~19,~32,lib/std/system.nim (i -1)) ~4,~3 . ~2,~3 (object . ~19,1 diff --git a/tests/nimony/sysbasics/tdollar.nif b/tests/nimony/sysbasics/tdollar.nif index 21bb2f3c..f53de23f 100644 --- a/tests/nimony/sysbasics/tdollar.nif +++ b/tests/nimony/sysbasics/tdollar.nif @@ -3,31 +3,31 @@ (type ~7 :Color1.0.tdoqc0e0v . . . 2 (enum (u +8) ~7,1 - (efld :Red1.0.tdoqc0e0v . . Color1.0.tdoqc0e0v + (efld :Red1.0.tdoqc0e0v . . Color1.0.tdoqc0e0v (tup +0 "Red1")) ~1,1 - (efld :Blue1.0.tdoqc0e0v . . Color1.0.tdoqc0e0v + (efld :Blue1.0.tdoqc0e0v . . Color1.0.tdoqc0e0v (tup +1 "Blue1")) 6,1 - (efld :Green1.0.tdoqc0e0v . . Color1.0.tdoqc0e0v + (efld :Green1.0.tdoqc0e0v . . Color1.0.tdoqc0e0v (tup +2 "Green1")))) 2,1 - (proc :dollar`.Color1.0.tdoqc0e0v x . . - (params + (proc :dollar`.Color1.0.tdoqc0e0v x . . + (params (param :e.0 . . Color1.0.tdoqc0e0v .)) - (string) . . + (string) . . (stmts 9 (result :result.0 . . (string) .) 9 (case e.0 ~7,1 - (of - (set Red1.0.tdoqc0e0v) - (stmts + (of + (set Red1.0.tdoqc0e0v) + (stmts (ret "Red1"))) ~1,1 - (of - (set Blue1.0.tdoqc0e0v) - (stmts + (of + (set Blue1.0.tdoqc0e0v) + (stmts (ret "Blue1"))) 6,1 - (of - (set Green1.0.tdoqc0e0v) - (stmts + (of + (set Green1.0.tdoqc0e0v) + (stmts (ret "Green1")))) (ret result.0))) ,5 (proc 5 :fooColor.0.tdoqc0e0v . . . 14 diff --git a/tests/nimony/sysbasics/thooks.nif b/tests/nimony/sysbasics/thooks.nif index 98951051..fe50578f 100644 --- a/tests/nimony/sysbasics/thooks.nif +++ b/tests/nimony/sysbasics/thooks.nif @@ -21,14 +21,14 @@ (mut 4 MyObjectBase.0.tho8gh7q4) .) 22 (param :p.0 . . ~31,41,lib/std/system.nim (pointer) .)) . . . 2,1 - (stmts + (stmts (discard .))) ,7 (tracer MyObjectBase.0.tho8gh7q4 =trace.0.tho8gh7q4) ,10 (proc 5 :=wasMoved.0.tho8gh7q4 . . . 16 (params 1 (param :x.1 . . 3 (mut 4 MyObjectBase.0.tho8gh7q4) .)) . . . 2,1 - (stmts + (stmts (discard .))) ,10 (disarmer MyObjectBase.0.tho8gh7q4 =wasMoved.0.tho8gh7q4) ,13 (proc 5 :=copy.0.tho8gh7q4 . . . 12 @@ -36,7 +36,7 @@ (param :x.2 . . 3 (mut 4 MyObjectBase.0.tho8gh7q4) .) 22 (param :y.0 . . 3 MyObjectBase.0.tho8gh7q4 .)) . . . 2,1 - (stmts + (stmts (discard .))) ,13 (cloner MyObjectBase.0.tho8gh7q4 =copy.0.tho8gh7q4) ,16 (proc 5 :=sink.0.tho8gh7q4 . . . 12 @@ -44,13 +44,13 @@ (param :x.3 . . 3 (mut 4 MyObjectBase.0.tho8gh7q4) .) 22 (param :y.1 . . 3 MyObjectBase.0.tho8gh7q4 .)) . . . 2,1 - (stmts + (stmts (discard .))) ,16 (mover MyObjectBase.0.tho8gh7q4 =sink.0.tho8gh7q4) ,19 (proc 5 :=destroy.0.tho8gh7q4 . . . 15 (params 1 (param :x.4 . . 3 MyObjectBase.0.tho8gh7q4 .)) . . . 2,1 - (stmts + (stmts (discard .))) ,19 (dtor MyObjectBase.0.tho8gh7q4 =destroy.0.tho8gh7q4) ,22 (proc 5 :=wasMoved.1.tho8gh7q4 . . 16 @@ -76,7 +76,7 @@ (at ~8 MyObject.0.tho8gh7q4 1 T.2.tho8gh7q4 4 Y.2.tho8gh7q4)) .) 24 (param :y.2 . . 11 (at ~8 MyObject.0.tho8gh7q4 1 T.2.tho8gh7q4 4 Y.2.tho8gh7q4) .)) . . . 2,1 - (stmts + (stmts (discard .))) ,29 (proc 5 :=sink.1.tho8gh7q4 . . 12 (typevars 1 @@ -88,7 +88,7 @@ (at ~8 MyObject.0.tho8gh7q4 1 T.3.tho8gh7q4 4 Y.3.tho8gh7q4)) .) 24 (param :y.3 . . 11 (at ~8 MyObject.0.tho8gh7q4 1 T.3.tho8gh7q4 4 Y.3.tho8gh7q4) .)) . . . 2,1 - (stmts + (stmts (discard .))) ,32 (proc 5 :=destroy.1.tho8gh7q4 . . 15 (typevars 1 @@ -118,11 +118,11 @@ (params 1 (param :x.9 . . 12 (at ~8 MyObject.0.tho8gh7q4 1 T.5.tho8gh7q4 4 Y.5.tho8gh7q4) .)) . . . 2,1 - (stmts + (stmts (discard .))) 4,52 (var :obj.0.tho8gh7q4 . . 13 MyObject.1.tho8gh7q4 .) 12,53 (call 1 =checkHook.1.tho8gh7q4 1 obj.0.tho8gh7q4) 12,40 - (proc :=destroy.2.tho8gh7q4 . ~12,~8 . + (proc :=destroy.2.tho8gh7q4 . ~12,~8 . (at =destroy.1.tho8gh7q4 ~8,~34,lib/std/system.nim (i -1) ~8,~8,lib/std/system.nim (f +64)) 9,~8 @@ -132,15 +132,15 @@ (let :x.15 . . ~2,~27,lib/std/system.nim (i -1) 4 +12))) 12,40 (dtor MyObject.1.tho8gh7q4 =destroy.2.tho8gh7q4) 12,53 - (proc :=checkHook.1.tho8gh7q4 . ~12,~4 . + (proc :=checkHook.1.tho8gh7q4 . ~12,~4 . (at =checkHook.0.tho8gh7q4 ~8,~47,lib/std/system.nim (i -1) ~8,~21,lib/std/system.nim (f +64)) 11,~4 (params 1 (param :x.16 . . 12 MyObject.1.tho8gh7q4 .)) ~12,~4 . ~12,~4 . ~12,~4 . ~10,~3 - (stmts + (stmts (discard .))) 19,36 - (type :MyObject.1.tho8gh7q4 . + (type :MyObject.1.tho8gh7q4 . (at MyObject.0.tho8gh7q4 ~15,~30,lib/std/system.nim (i -1) ~15,~4,lib/std/system.nim (f +64)) ~2,~32 . ,~32 @@ -149,7 +149,7 @@ (i -1) .) ~12,1 (fld :y.2.tho8gh7q4 . . ~3,1,lib/std/system.nim (i -1) .))) 20,38 - (type :MyObject.2.tho8gh7q4 . + (type :MyObject.2.tho8gh7q4 . (at MyObject.0.tho8gh7q4 ~16,~6,lib/std/system.nim (f +64) ~16,~32,lib/std/system.nim (i -1)) ~3,~34 . ~1,~34 @@ -158,7 +158,7 @@ (i -1) .) ~12,1 (fld :y.3.tho8gh7q4 . . ~3,1,lib/std/system.nim (i -1) .))) ,22 - (proc :=wasMoved.2.tho8gh7q4 . . + (proc :=wasMoved.2.tho8gh7q4 . . (at =wasMoved.1.tho8gh7q4 4,~16,lib/std/system.nim (i -1) 4,10,lib/std/system.nim (f +64)) 22 @@ -171,7 +171,7 @@ (let :y.9 . . ~2,~18,lib/std/system.nim (i -1) 4 +4))) ,22 (disarmer MyObject.1.tho8gh7q4 =wasMoved.2.tho8gh7q4) ,26 - (proc :=copy.2.tho8gh7q4 . . + (proc :=copy.2.tho8gh7q4 . . (at =copy.1.tho8gh7q4 4,~20,lib/std/system.nim (i -1) 4,6,lib/std/system.nim (f +64)) 18 @@ -179,10 +179,10 @@ (param :x.26 . . 3 (mut 12 MyObject.1.tho8gh7q4) .) 24 (param :y.10 . . 11 MyObject.1.tho8gh7q4 .)) . . . 2,1 - (stmts + (stmts (discard .))) ,26 (cloner MyObject.1.tho8gh7q4 =copy.2.tho8gh7q4) ,29 - (proc :=sink.2.tho8gh7q4 . . + (proc :=sink.2.tho8gh7q4 . . (at =sink.1.tho8gh7q4 4,~23,lib/std/system.nim (i -1) 4,3,lib/std/system.nim (f +64)) 18 @@ -190,10 +190,10 @@ (param :x.27 . . 3 (mut 12 MyObject.1.tho8gh7q4) .) 24 (param :y.11 . . 11 MyObject.1.tho8gh7q4 .)) . . . 2,1 - (stmts + (stmts (discard .))) ,29 (mover MyObject.1.tho8gh7q4 =sink.2.tho8gh7q4) ,22 - (proc :=wasMoved.3.tho8gh7q4 . . + (proc :=wasMoved.3.tho8gh7q4 . . (at =wasMoved.1.tho8gh7q4 4,10,lib/std/system.nim (f +64) 4,~16,lib/std/system.nim (i -1)) 22 @@ -206,7 +206,7 @@ (let :y.12 . . ~2,~18,lib/std/system.nim (i -1) 4 +4))) ,22 (disarmer MyObject.2.tho8gh7q4 =wasMoved.3.tho8gh7q4) ,26 - (proc :=copy.3.tho8gh7q4 . . + (proc :=copy.3.tho8gh7q4 . . (at =copy.1.tho8gh7q4 4,6,lib/std/system.nim (f +64) 4,~20,lib/std/system.nim (i -1)) 18 @@ -214,10 +214,10 @@ (param :x.30 . . 3 (mut 12 MyObject.2.tho8gh7q4) .) 24 (param :y.13 . . 11 MyObject.2.tho8gh7q4 .)) . . . 2,1 - (stmts + (stmts (discard .))) ,26 (cloner MyObject.2.tho8gh7q4 =copy.3.tho8gh7q4) ,29 - (proc :=sink.3.tho8gh7q4 . . + (proc :=sink.3.tho8gh7q4 . . (at =sink.1.tho8gh7q4 4,3,lib/std/system.nim (f +64) 4,~23,lib/std/system.nim (i -1)) 18 @@ -225,10 +225,10 @@ (param :x.31 . . 3 (mut 12 MyObject.2.tho8gh7q4) .) 24 (param :y.14 . . 11 MyObject.2.tho8gh7q4 .)) . . . 2,1 - (stmts + (stmts (discard .))) ,29 (mover MyObject.2.tho8gh7q4 =sink.3.tho8gh7q4) ,32 - (proc :=destroy.3.tho8gh7q4 . . + (proc :=destroy.3.tho8gh7q4 . . (at =destroy.1.tho8gh7q4 4,,lib/std/system.nim (f +64) 4,~26,lib/std/system.nim (i -1)) 21