about summary refs log tree commit diff stats
path: root/cpp/.traces
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/.traces')
-rw-r--r--cpp/.traces/brace_conversion5
-rw-r--r--cpp/.traces/break_cascading7
-rw-r--r--cpp/.traces/break_cascading213
-rw-r--r--cpp/.traces/break_empty_block5
-rw-r--r--cpp/.traces/break_if15
-rw-r--r--cpp/.traces/break_label5
-rw-r--r--cpp/.traces/break_nested14
-rw-r--r--cpp/.traces/break_nested_degenerate11
-rw-r--r--cpp/.traces/break_nested_degenerate28
-rw-r--r--cpp/.traces/break_unless14
-rw-r--r--cpp/.traces/factorial168
-rw-r--r--cpp/.traces/jump_backward3
-rw-r--r--cpp/.traces/jump_can_skip_instructions1
-rw-r--r--cpp/.traces/loop13
-rw-r--r--cpp/.traces/loop_label10
-rw-r--r--cpp/.traces/loop_nested28
-rw-r--r--cpp/.traces/loop_unless14
17 files changed, 212 insertions, 122 deletions
diff --git a/cpp/.traces/brace_conversion b/cpp/.traces/brace_conversion
index 2c082bad..22021677 100644
--- a/cpp/.traces/brace_conversion
+++ b/cpp/.traces/brace_conversion
@@ -9,8 +9,3 @@ brace/0: push (close, 3)
 after-brace/0: recipe main
 after-brace/0: jump 1:offset
 after-brace/0: copy ...
-run/0: instruction main/1
-run/0: ingredient 0 is 
-run/0: instruction main/2
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
diff --git a/cpp/.traces/break_cascading b/cpp/.traces/break_cascading
index 56a532a7..c89a1698 100644
--- a/cpp/.traces/break_cascading
+++ b/cpp/.traces/break_cascading
@@ -15,10 +15,3 @@ after-brace/0: recipe main
 after-brace/0: copy ...
 after-brace/0: jump 0:offset
 after-brace/0: jump 0:offset
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/2
-run/0: ingredient 0 is 
-run/0: instruction main/5
-run/0: ingredient 0 is 
diff --git a/cpp/.traces/break_cascading2 b/cpp/.traces/break_cascading2
index 7b837b2a..6492fb8f 100644
--- a/cpp/.traces/break_cascading2
+++ b/cpp/.traces/break_cascading2
@@ -23,16 +23,3 @@ after-brace/0: copy ...
 after-brace/0: jump 1:offset
 after-brace/0: copy ...
 after-brace/0: jump 0:offset
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/1
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-run/0: ingredient 0 is 
-run/0: instruction main/4
-run/0: ingredient 0 is 0
-mem/0: storing in location 3
-run/0: instruction main/7
-run/0: ingredient 0 is 
diff --git a/cpp/.traces/break_empty_block b/cpp/.traces/break_empty_block
index d66fe136..305e2a1e 100644
--- a/cpp/.traces/break_empty_block
+++ b/cpp/.traces/break_empty_block
@@ -9,8 +9,3 @@ brace/0: push (close, 3)
 after-brace/0: recipe main
 after-brace/0: copy ...
 after-brace/0: jump 0:offset
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/2
-run/0: ingredient 0 is 
diff --git a/cpp/.traces/break_if b/cpp/.traces/break_if
index 34274a91..1e7ff661 100644
--- a/cpp/.traces/break_if
+++ b/cpp/.traces/break_if
@@ -24,18 +24,3 @@ after-brace/0: copy ...
 after-brace/0: jump-if 2, 1:offset
 after-brace/0: copy ...
 after-brace/0: jump 0:offset
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/1
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-mem/0: location 2 is 0
-run/0: ingredient 0 is 0
-run/0: jump-if fell through
-run/0: instruction main/4
-run/0: ingredient 0 is 0
-mem/0: storing in location 3
-run/0: instruction main/7
-run/0: ingredient 0 is 
diff --git a/cpp/.traces/break_label b/cpp/.traces/break_label
index 23ce2727..5230e22e 100644
--- a/cpp/.traces/break_label
+++ b/cpp/.traces/break_label
@@ -10,8 +10,3 @@ brace/0: push (close, 3)
 after-brace/0: recipe main
 after-brace/0: copy ...
 after-brace/0: jump +foo:offset
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/2
-run/0: ingredient 0 is +foo
diff --git a/cpp/.traces/break_nested b/cpp/.traces/break_nested
index ed3afda6..a4d242ce 100644
--- a/cpp/.traces/break_nested
+++ b/cpp/.traces/break_nested
@@ -25,17 +25,3 @@ after-brace/0: copy ...
 after-brace/0: jump 4:offset
 after-brace/0: copy ...
 after-brace/0: copy ...
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/2
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-run/0: ingredient 0 is 
-run/0: instruction main/5
-run/0: ingredient 0 is 0
-mem/0: storing in location 3
-run/0: instruction main/7
-run/0: ingredient 0 is 0
-mem/0: storing in location 4
diff --git a/cpp/.traces/break_nested_degenerate b/cpp/.traces/break_nested_degenerate
index 2f09b01d..2a113ff9 100644
--- a/cpp/.traces/break_nested_degenerate
+++ b/cpp/.traces/break_nested_degenerate
@@ -21,14 +21,3 @@ after-brace/0: copy ...
 after-brace/0: copy ...
 after-brace/0: jump 3:offset
 after-brace/0: copy ...
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/2
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-run/0: ingredient 0 is 
-run/0: instruction main/6
-run/0: ingredient 0 is 0
-mem/0: storing in location 4
diff --git a/cpp/.traces/break_nested_degenerate2 b/cpp/.traces/break_nested_degenerate2
index 7dd3ba16..586a73eb 100644
--- a/cpp/.traces/break_nested_degenerate2
+++ b/cpp/.traces/break_nested_degenerate2
@@ -17,11 +17,3 @@ after-brace/0: recipe main
 after-brace/0: copy ...
 after-brace/0: copy ...
 after-brace/0: jump 2:offset
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/2
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-run/0: ingredient 0 is 
diff --git a/cpp/.traces/break_unless b/cpp/.traces/break_unless
index b227e1ab..5528ce60 100644
--- a/cpp/.traces/break_unless
+++ b/cpp/.traces/break_unless
@@ -18,17 +18,3 @@ after-brace/0: copy ...
 after-brace/0: copy ...
 after-brace/0: jump-unless 2, 1:offset
 after-brace/0: copy ...
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/1
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-mem/0: location 2 is 0
-run/0: ingredient 0 is 0
-run/0: ingredient 1 is 
-run/0: jumping to instruction 4
-run/0: instruction main/4
-run/0: ingredient 0 is 0
-mem/0: storing in location 3
diff --git a/cpp/.traces/factorial b/cpp/.traces/factorial
new file mode 100644
index 00000000..ef8fff86
--- /dev/null
+++ b/cpp/.traces/factorial
@@ -0,0 +1,168 @@
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "5", value: 0, type: 0, properties: [5: literal]}
+parse/0:   product: {name: "1", value: 0, type: 1, properties: [1: integer]}
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "1", value: 0, type: 0, properties: [1: literal]}
+parse/0:   product: {name: "2", value: 0, type: 1, properties: [2: integer]}
+parse/0: label: {
+parse/0: instruction: 13
+parse/0:   ingredient: {name: "1", value: 0, type: 1, properties: [1: integer]}
+parse/0:   ingredient: {name: "1", value: 0, type: 0, properties: [1: literal]}
+parse/0:   product: {name: "3", value: 0, type: 3, properties: [3: boolean]}
+parse/0: instruction: 25
+parse/0:   ingredient: {name: "3", value: 0, type: 3, properties: [3: boolean]}
+parse/0: instruction: 4
+parse/0:   ingredient: {name: "2", value: 0, type: 1, properties: [2: integer]}
+parse/0:   ingredient: {name: "1", value: 0, type: 1, properties: [1: integer]}
+parse/0:   product: {name: "2", value: 0, type: 1, properties: [2: integer]}
+parse/0: instruction: 3
+parse/0:   ingredient: {name: "1", value: 0, type: 1, properties: [1: integer]}
+parse/0:   ingredient: {name: "1", value: 0, type: 0, properties: [1: literal]}
+parse/0:   product: {name: "1", value: 0, type: 1, properties: [1: integer]}
+parse/0: instruction: 26
+parse/0: label: }
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "2", value: 0, type: 1, properties: [2: integer]}
+parse/0:   product: {name: "4", value: 0, type: 1, properties: [4: integer]}
+brace/0: 24: push (open, 2)
+brace/0: push (close, 8)
+after-brace/0: recipe factorial
+after-brace/0: copy ...
+after-brace/0: copy ...
+after-brace/0: equal ...
+after-brace/0: jump-if 3, 3:offset
+after-brace/0: multiply ...
+after-brace/0: subtract ...
+after-brace/0: jump -5:offset
+after-brace/0: 7: {name: "", value: -5, type: 0}
+after-brace/0: 7: {name: "", value: -5, type: 0}
+after-brace/0: copy ...
+run/0: instruction factorial/0
+run/0: ingredient 0 is 5
+mem/0: storing in location 1
+run/0: instruction factorial/1
+run/0: ingredient 0 is 1
+mem/0: storing in location 2
+run/0: instruction factorial/3
+run/0: ingredient 0 is 1
+mem/0: location 1 is 5
+run/0: ingredient 1 is 1
+run/0: product 0 is 0
+mem/0: storing in location 3
+run/0: instruction factorial/4
+mem/0: location 3 is 0
+run/0: ingredient 0 is 0
+run/0: jump-if fell through
+run/0: instruction factorial/5
+run/0: ingredient 0 is 2
+mem/0: location 2 is 1
+run/0: ingredient 1 is 1
+mem/0: location 1 is 5
+run/0: ingredient 1 is 5
+run/0: product 0 is 5
+mem/0: storing in location 2
+run/0: instruction factorial/6
+run/0: ingredient 0 is 1
+mem/0: location 1 is 5
+run/0: ingredient 1 is 1
+run/0: product 0 is 4
+mem/0: storing in location 1
+run/0: instruction factorial/7
+run/0: ingredient 0 is -5
+run/0: pc now 2
+run/0: instruction factorial/3
+run/0: ingredient 0 is 1
+mem/0: location 1 is 4
+run/0: ingredient 1 is 1
+run/0: product 0 is 0
+mem/0: storing in location 3
+run/0: instruction factorial/4
+mem/0: location 3 is 0
+run/0: ingredient 0 is 0
+run/0: jump-if fell through
+run/0: instruction factorial/5
+run/0: ingredient 0 is 2
+mem/0: location 2 is 5
+run/0: ingredient 1 is 1
+mem/0: location 1 is 4
+run/0: ingredient 1 is 4
+run/0: product 0 is 20
+mem/0: storing in location 2
+run/0: instruction factorial/6
+run/0: ingredient 0 is 1
+mem/0: location 1 is 4
+run/0: ingredient 1 is 1
+run/0: product 0 is 3
+mem/0: storing in location 1
+run/0: instruction factorial/7
+run/0: ingredient 0 is -5
+run/0: pc now 2
+run/0: instruction factorial/3
+run/0: ingredient 0 is 1
+mem/0: location 1 is 3
+run/0: ingredient 1 is 1
+run/0: product 0 is 0
+mem/0: storing in location 3
+run/0: instruction factorial/4
+mem/0: location 3 is 0
+run/0: ingredient 0 is 0
+run/0: jump-if fell through
+run/0: instruction factorial/5
+run/0: ingredient 0 is 2
+mem/0: location 2 is 20
+run/0: ingredient 1 is 1
+mem/0: location 1 is 3
+run/0: ingredient 1 is 3
+run/0: product 0 is 60
+mem/0: storing in location 2
+run/0: instruction factorial/6
+run/0: ingredient 0 is 1
+mem/0: location 1 is 3
+run/0: ingredient 1 is 1
+run/0: product 0 is 2
+mem/0: storing in location 1
+run/0: instruction factorial/7
+run/0: ingredient 0 is -5
+run/0: pc now 2
+run/0: instruction factorial/3
+run/0: ingredient 0 is 1
+mem/0: location 1 is 2
+run/0: ingredient 1 is 1
+run/0: product 0 is 0
+mem/0: storing in location 3
+run/0: instruction factorial/4
+mem/0: location 3 is 0
+run/0: ingredient 0 is 0
+run/0: jump-if fell through
+run/0: instruction factorial/5
+run/0: ingredient 0 is 2
+mem/0: location 2 is 60
+run/0: ingredient 1 is 1
+mem/0: location 1 is 2
+run/0: ingredient 1 is 2
+run/0: product 0 is 120
+mem/0: storing in location 2
+run/0: instruction factorial/6
+run/0: ingredient 0 is 1
+mem/0: location 1 is 2
+run/0: ingredient 1 is 1
+run/0: product 0 is 1
+mem/0: storing in location 1
+run/0: instruction factorial/7
+run/0: ingredient 0 is -5
+run/0: pc now 2
+run/0: instruction factorial/3
+run/0: ingredient 0 is 1
+mem/0: location 1 is 1
+run/0: ingredient 1 is 1
+run/0: product 0 is 1
+mem/0: storing in location 3
+run/0: instruction factorial/4
+mem/0: location 3 is 1
+run/0: ingredient 0 is 1
+run/0: ingredient 1 is 
+run/0: jumping to instruction 8
+run/0: instruction factorial/9
+run/0: ingredient 0 is 2
+mem/0: location 2 is 120
+mem/0: storing in location 4
diff --git a/cpp/.traces/jump_backward b/cpp/.traces/jump_backward
index b9cf549c..4b9f17df 100644
--- a/cpp/.traces/jump_backward
+++ b/cpp/.traces/jump_backward
@@ -10,7 +10,10 @@ after-brace/0: jump ...
 after-brace/0: jump ...
 run/0: instruction main/0
 run/0: ingredient 0 is 1
+run/0: pc now 1
 run/0: instruction main/2
 run/0: ingredient 0 is -2
+run/0: pc now 0
 run/0: instruction main/1
 run/0: ingredient 0 is 1
+run/0: pc now 2
diff --git a/cpp/.traces/jump_can_skip_instructions b/cpp/.traces/jump_can_skip_instructions
index 3e0f1bfd..3a42a0f1 100644
--- a/cpp/.traces/jump_can_skip_instructions
+++ b/cpp/.traces/jump_can_skip_instructions
@@ -8,3 +8,4 @@ after-brace/0: jump ...
 after-brace/0: copy ...
 run/0: instruction main/0
 run/0: ingredient 0 is 1
+run/0: pc now 1
diff --git a/cpp/.traces/loop b/cpp/.traces/loop
index 2c05c2fb..26d2dbc8 100644
--- a/cpp/.traces/loop
+++ b/cpp/.traces/loop
@@ -17,14 +17,5 @@ after-brace/0: copy ...
 after-brace/0: copy ...
 after-brace/0: copy ...
 after-brace/0: jump -2:offset
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/1
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-run/0: ingredient 0 is 0
-mem/0: storing in location 3
-run/0: instruction main/4
-run/0: ingredient 0 is 
+after-brace/0: 4: {name: "", value: -2, type: 0}
+after-brace/0: 4: {name: "", value: -2, type: 0}
diff --git a/cpp/.traces/loop_label b/cpp/.traces/loop_label
new file mode 100644
index 00000000..990c175f
--- /dev/null
+++ b/cpp/.traces/loop_label
@@ -0,0 +1,10 @@
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
+parse/0:   product: {name: "1", value: 0, type: 1, properties: [1: integer]}
+parse/0: label: +foo
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
+parse/0:   product: {name: "2", value: 0, type: 1, properties: [2: integer]}
+after-brace/0: recipe main
+after-brace/0: copy ...
+after-brace/0: copy ...
diff --git a/cpp/.traces/loop_nested b/cpp/.traces/loop_nested
new file mode 100644
index 00000000..9e865605
--- /dev/null
+++ b/cpp/.traces/loop_nested
@@ -0,0 +1,28 @@
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
+parse/0:   product: {name: "1", value: 0, type: 1, properties: [1: integer]}
+parse/0: label: {
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
+parse/0:   product: {name: "2", value: 0, type: 1, properties: [2: integer]}
+parse/0: label: {
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
+parse/0:   product: {name: "3", value: 0, type: 1, properties: [3: integer]}
+parse/0: label: }
+parse/0: instruction: 25
+parse/0:   ingredient: {name: "4", value: 0, type: 3, properties: [4: boolean]}
+parse/0: instruction: 1
+parse/0:   ingredient: {name: "0", value: 0, type: 0, properties: [0: literal]}
+parse/0:   product: {name: "5", value: 0, type: 1, properties: [5: integer]}
+parse/0: label: }
+brace/0: 24: push (open, 1)
+brace/0: 24: push (open, 3)
+brace/0: push (close, 5)
+brace/0: push (close, 8)
+after-brace/0: recipe main
+after-brace/0: copy ...
+after-brace/0: copy ...
+after-brace/0: copy ...
+after-brace/0: jump-if 4, -5:offset
+after-brace/0: copy ...
diff --git a/cpp/.traces/loop_unless b/cpp/.traces/loop_unless
index 35a3cc8a..ef736ca6 100644
--- a/cpp/.traces/loop_unless
+++ b/cpp/.traces/loop_unless
@@ -18,17 +18,3 @@ after-brace/0: copy ...
 after-brace/0: copy ...
 after-brace/0: jump-unless 2, -1:offset
 after-brace/0: copy ...
-run/0: instruction main/0
-run/0: ingredient 0 is 0
-mem/0: storing in location 1
-run/0: instruction main/1
-run/0: ingredient 0 is 0
-mem/0: storing in location 2
-run/0: instruction main/3
-mem/0: location 2 is 0
-run/0: ingredient 0 is 0
-run/0: ingredient 1 is 
-run/0: jumping to instruction 4
-run/0: instruction main/4
-run/0: ingredient 0 is 0
-mem/0: storing in location 3