From 442a33019c03480612290b4741b07a0caa310d3d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 9 Apr 2015 17:55:18 -0700 Subject: 1045 --- cpp/.traces/brace_conversion | 2 +- cpp/.traces/break_cascading | 4 ++-- cpp/.traces/break_cascading2 | 4 ++-- cpp/.traces/break_empty_block | 2 +- cpp/.traces/break_if | 4 ++-- cpp/.traces/break_label | 2 +- cpp/.traces/break_nested | 4 ++-- cpp/.traces/break_nested_degenerate | 4 ++-- cpp/.traces/break_nested_degenerate2 | 4 ++-- cpp/.traces/break_unless | 2 +- cpp/.traces/calling_recipe | 6 +++--- cpp/.traces/factorial | 2 +- cpp/.traces/loop | 2 +- cpp/.traces/loop_nested | 4 ++-- cpp/.traces/loop_unless | 2 +- cpp/.traces/next_ingredient | 6 +++--- cpp/.traces/reply | 6 +++--- cpp/.traces/reply_record | 6 +++--- cpp/.traces/string-equal-common-lengths-but-distinct | 2 +- cpp/.traces/string-equal-distinct-lengths | 2 +- cpp/.traces/string-equal-identical | 2 +- cpp/.traces/string-equal-reflexive | 2 +- cpp/.traces/string-equal-with-empty | 2 +- cpp/010vm | 8 +++++--- 24 files changed, 43 insertions(+), 41 deletions(-) diff --git a/cpp/.traces/brace_conversion b/cpp/.traces/brace_conversion index 455b7cd2..5c203a41 100644 --- a/cpp/.traces/brace_conversion +++ b/cpp/.traces/brace_conversion @@ -4,7 +4,7 @@ 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: } -brace/0: 100: push (open, 0) +brace/0: 1000: push (open, 0) brace/0: push (close, 3) after-brace/0: recipe main after-brace/0: jump 1:offset diff --git a/cpp/.traces/break_cascading b/cpp/.traces/break_cascading index ee835faa..b7ed6d16 100644 --- a/cpp/.traces/break_cascading +++ b/cpp/.traces/break_cascading @@ -7,9 +7,9 @@ parse/0: label: } parse/0: label: { parse/0: instruction: 24 parse/0: label: } -brace/0: 100: push (open, 1) +brace/0: 1000: push (open, 1) brace/0: push (close, 3) -brace/0: 100: push (open, 4) +brace/0: 1000: push (open, 4) brace/0: push (close, 6) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/break_cascading2 b/cpp/.traces/break_cascading2 index c72e2cf6..3154e219 100644 --- a/cpp/.traces/break_cascading2 +++ b/cpp/.traces/break_cascading2 @@ -13,9 +13,9 @@ parse/0: label: } parse/0: label: { parse/0: instruction: 24 parse/0: label: } -brace/0: 100: push (open, 2) +brace/0: 1000: push (open, 2) brace/0: push (close, 5) -brace/0: 100: push (open, 6) +brace/0: 1000: push (open, 6) brace/0: push (close, 8) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/break_empty_block b/cpp/.traces/break_empty_block index ba91f9b1..75d85845 100644 --- a/cpp/.traces/break_empty_block +++ b/cpp/.traces/break_empty_block @@ -4,7 +4,7 @@ parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} parse/0: label: { parse/0: instruction: 24 parse/0: label: } -brace/0: 100: push (open, 1) +brace/0: 1000: push (open, 1) brace/0: push (close, 3) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/break_if b/cpp/.traces/break_if index 0b02ca42..4b9f1654 100644 --- a/cpp/.traces/break_if +++ b/cpp/.traces/break_if @@ -14,9 +14,9 @@ parse/0: label: } parse/0: label: { parse/0: instruction: 24 parse/0: label: } -brace/0: 100: push (open, 2) +brace/0: 1000: push (open, 2) brace/0: push (close, 5) -brace/0: 100: push (open, 6) +brace/0: 1000: push (open, 6) brace/0: push (close, 8) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/break_label b/cpp/.traces/break_label index e948e7e7..bc2c89b5 100644 --- a/cpp/.traces/break_label +++ b/cpp/.traces/break_label @@ -5,7 +5,7 @@ parse/0: label: { parse/0: instruction: 24 parse/0: ingredient: {name: "+foo", value: 0, type: 0, properties: ["+foo": "offset"]} parse/0: label: } -brace/0: 100: push (open, 1) +brace/0: 1000: push (open, 1) brace/0: push (close, 3) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/break_nested b/cpp/.traces/break_nested index 8a2ac302..5513254e 100644 --- a/cpp/.traces/break_nested +++ b/cpp/.traces/break_nested @@ -15,8 +15,8 @@ parse/0: instruction: 1 parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} parse/0: label: } -brace/0: 100: push (open, 1) -brace/0: 100: push (open, 4) +brace/0: 1000: push (open, 1) +brace/0: 1000: push (open, 4) brace/0: push (close, 6) brace/0: push (close, 8) after-brace/0: recipe main diff --git a/cpp/.traces/break_nested_degenerate b/cpp/.traces/break_nested_degenerate index e68442d3..30ce0e3e 100644 --- a/cpp/.traces/break_nested_degenerate +++ b/cpp/.traces/break_nested_degenerate @@ -12,8 +12,8 @@ parse/0: instruction: 1 parse/0: ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]} parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} parse/0: label: } -brace/0: 100: push (open, 1) -brace/0: 100: push (open, 4) +brace/0: 1000: push (open, 1) +brace/0: 1000: push (open, 4) brace/0: push (close, 5) brace/0: push (close, 7) after-brace/0: recipe main diff --git a/cpp/.traces/break_nested_degenerate2 b/cpp/.traces/break_nested_degenerate2 index 2a871e43..c071c872 100644 --- a/cpp/.traces/break_nested_degenerate2 +++ b/cpp/.traces/break_nested_degenerate2 @@ -9,8 +9,8 @@ parse/0: instruction: 24 parse/0: label: { parse/0: label: } parse/0: label: } -brace/0: 100: push (open, 1) -brace/0: 100: push (open, 4) +brace/0: 1000: push (open, 1) +brace/0: 1000: push (open, 4) brace/0: push (close, 5) brace/0: push (close, 6) after-brace/0: recipe main diff --git a/cpp/.traces/break_unless b/cpp/.traces/break_unless index fdff7f87..8a2cde50 100644 --- a/cpp/.traces/break_unless +++ b/cpp/.traces/break_unless @@ -11,7 +11,7 @@ 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: } -brace/0: 100: push (open, 2) +brace/0: 1000: push (open, 2) brace/0: push (close, 5) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/calling_recipe b/cpp/.traces/calling_recipe index 01cba63e..cb35c59d 100644 --- a/cpp/.traces/calling_recipe +++ b/cpp/.traces/calling_recipe @@ -1,12 +1,12 @@ -parse/0: instruction: 101 +parse/0: instruction: 1001 parse/0: instruction: 2 parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... after-brace/0: recipe f after-brace/0: add ... +after-brace/0: recipe main +after-brace/0: f ... run/0: instruction main/0 run/0: instruction f/0 run/0: ingredient 0 is 2 diff --git a/cpp/.traces/factorial b/cpp/.traces/factorial index 04c1e0ba..6cd0a307 100644 --- a/cpp/.traces/factorial +++ b/cpp/.traces/factorial @@ -24,7 +24,7 @@ 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: 100: push (open, 2) +brace/0: 1000: push (open, 2) brace/0: push (close, 8) after-brace/0: recipe factorial after-brace/0: copy ... diff --git a/cpp/.traces/loop b/cpp/.traces/loop index e37e3dac..0d8a1496 100644 --- a/cpp/.traces/loop +++ b/cpp/.traces/loop @@ -10,7 +10,7 @@ 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: instruction: 27 parse/0: label: } -brace/0: 100: push (open, 2) +brace/0: 1000: push (open, 2) brace/0: push (close, 5) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/loop_nested b/cpp/.traces/loop_nested index 44f69eef..09ba9c37 100644 --- a/cpp/.traces/loop_nested +++ b/cpp/.traces/loop_nested @@ -16,8 +16,8 @@ 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: 100: push (open, 1) -brace/0: 100: push (open, 3) +brace/0: 1000: push (open, 1) +brace/0: 1000: push (open, 3) brace/0: push (close, 5) brace/0: push (close, 8) after-brace/0: recipe main diff --git a/cpp/.traces/loop_unless b/cpp/.traces/loop_unless index 5394cba5..c8e6e8d7 100644 --- a/cpp/.traces/loop_unless +++ b/cpp/.traces/loop_unless @@ -11,7 +11,7 @@ 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: } -brace/0: 100: push (open, 2) +brace/0: 1000: push (open, 2) brace/0: push (close, 5) after-brace/0: recipe main after-brace/0: copy ... diff --git a/cpp/.traces/next_ingredient b/cpp/.traces/next_ingredient index d1a3adfd..d515b829 100644 --- a/cpp/.traces/next_ingredient +++ b/cpp/.traces/next_ingredient @@ -1,4 +1,4 @@ -parse/0: instruction: 101 +parse/0: instruction: 1001 parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} parse/0: instruction: 22 parse/0: product: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} @@ -6,11 +6,11 @@ parse/0: instruction: 2 parse/0: ingredient: {name: "1", value: 0, type: 0, properties: ["1": "literal"]} parse/0: ingredient: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... after-brace/0: recipe f after-brace/0: next-ingredient ... after-brace/0: add ... +after-brace/0: recipe main +after-brace/0: f ... run/0: instruction main/0 run/0: instruction f/0 run/0: product 0 is 2 diff --git a/cpp/.traces/reply b/cpp/.traces/reply index 499a9441..b2553ebc 100644 --- a/cpp/.traces/reply +++ b/cpp/.traces/reply @@ -1,4 +1,4 @@ -parse/0: instruction: 101 +parse/0: instruction: 1001 parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} parse/0: product: {name: "3", value: 0, type: 1, properties: ["3": "integer"]} parse/0: product: {name: "4", value: 0, type: 1, properties: ["4": "integer"]} @@ -11,12 +11,12 @@ parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer" parse/0: instruction: 23 parse/0: ingredient: {name: "12", value: 0, type: 1, properties: ["12": "integer"]} parse/0: ingredient: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} -after-brace/0: recipe main -after-brace/0: f ... after-brace/0: recipe f after-brace/0: next-ingredient ... after-brace/0: add ... after-brace/0: reply ... +after-brace/0: recipe main +after-brace/0: f ... run/0: instruction main/0 run/0: instruction f/0 run/0: product 0 is 2 diff --git a/cpp/.traces/reply_record b/cpp/.traces/reply_record index cce9d8e3..1a3541e6 100644 --- a/cpp/.traces/reply_record +++ b/cpp/.traces/reply_record @@ -1,4 +1,4 @@ -parse/0: instruction: 101 +parse/0: instruction: 1001 parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} parse/0: product: {name: "3", value: 0, type: 6, properties: ["3": "point"]} parse/0: instruction: 22 @@ -8,12 +8,12 @@ parse/0: ingredient: {name: "35", value: 0, type: 0, properties: ["35": "liter parse/0: product: {name: "13", value: 0, type: 1, properties: ["13": "integer"]} parse/0: instruction: 23 parse/0: ingredient: {name: "12", value: 0, type: 6, properties: ["12": "point"]} -after-brace/0: recipe main -after-brace/0: f ... after-brace/0: recipe f after-brace/0: next-ingredient ... after-brace/0: copy ... after-brace/0: reply ... +after-brace/0: recipe main +after-brace/0: f ... run/0: instruction main/0 run/0: instruction f/0 run/0: product 0 is 2 diff --git a/cpp/.traces/string-equal-common-lengths-but-distinct b/cpp/.traces/string-equal-common-lengths-but-distinct index a65bf671..ac5a12ce 100644 --- a/cpp/.traces/string-equal-common-lengths-but-distinct +++ b/cpp/.traces/string-equal-common-lengths-but-distinct @@ -8,7 +8,7 @@ parse/0: product: {name: "x", value: 0, type: 2-5-8, properties: ["x": "addres parse/0: instruction: 30 parse/0: ingredient: {name: "abd", value: 0, type: 0, properties: ["abd": "literal-string"]} parse/0: product: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} -parse/0: instruction: 32 +parse/0: instruction: 100 parse/0: ingredient: {name: "x", value: 0, type: 2-5-8, properties: ["x": "address":"array":"character"]} parse/0: ingredient: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} diff --git a/cpp/.traces/string-equal-distinct-lengths b/cpp/.traces/string-equal-distinct-lengths index 55c980f5..98444b85 100644 --- a/cpp/.traces/string-equal-distinct-lengths +++ b/cpp/.traces/string-equal-distinct-lengths @@ -8,7 +8,7 @@ parse/0: product: {name: "x", value: 0, type: 2-5-8, properties: ["x": "addres parse/0: instruction: 30 parse/0: ingredient: {name: "abcd", value: 0, type: 0, properties: ["abcd": "literal-string"]} parse/0: product: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} -parse/0: instruction: 32 +parse/0: instruction: 100 parse/0: ingredient: {name: "x", value: 0, type: 2-5-8, properties: ["x": "address":"array":"character"]} parse/0: ingredient: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} diff --git a/cpp/.traces/string-equal-identical b/cpp/.traces/string-equal-identical index 6617774c..4a878121 100644 --- a/cpp/.traces/string-equal-identical +++ b/cpp/.traces/string-equal-identical @@ -8,7 +8,7 @@ parse/0: product: {name: "x", value: 0, type: 2-5-8, properties: ["x": "addres parse/0: instruction: 30 parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} parse/0: product: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} -parse/0: instruction: 32 +parse/0: instruction: 100 parse/0: ingredient: {name: "x", value: 0, type: 2-5-8, properties: ["x": "address":"array":"character"]} parse/0: ingredient: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} diff --git a/cpp/.traces/string-equal-reflexive b/cpp/.traces/string-equal-reflexive index 43ab5d7d..11d0aadf 100644 --- a/cpp/.traces/string-equal-reflexive +++ b/cpp/.traces/string-equal-reflexive @@ -5,7 +5,7 @@ parse/0: product: {name: "default-space", value: 0, type: 2-0, properties: ["d parse/0: instruction: 30 parse/0: ingredient: {name: "abc", value: 0, type: 0, properties: ["abc": "literal-string"]} parse/0: product: {name: "x", value: 0, type: 2-5-8, properties: ["x": "address":"array":"character"]} -parse/0: instruction: 32 +parse/0: instruction: 100 parse/0: ingredient: {name: "x", value: 0, type: 2-5-8, properties: ["x": "address":"array":"character"]} parse/0: ingredient: {name: "x", value: 0, type: 2-5-8, properties: ["x": "address":"array":"character"]} parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} diff --git a/cpp/.traces/string-equal-with-empty b/cpp/.traces/string-equal-with-empty index 9a447e51..12dcd23f 100644 --- a/cpp/.traces/string-equal-with-empty +++ b/cpp/.traces/string-equal-with-empty @@ -8,7 +8,7 @@ parse/0: product: {name: "x", value: 0, type: 2-5-8, properties: ["x": "addres parse/0: instruction: 30 parse/0: ingredient: {name: "abcd", value: 0, type: 0, properties: ["abcd": "literal-string"]} parse/0: product: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} -parse/0: instruction: 32 +parse/0: instruction: 100 parse/0: ingredient: {name: "x", value: 0, type: 2-5-8, properties: ["x": "address":"array":"character"]} parse/0: ingredient: {name: "y", value: 0, type: 2-5-8, properties: ["y": "address":"array":"character"]} parse/0: product: {name: "3", value: 0, type: 3, properties: ["3": "boolean", "raw": ]} diff --git a/cpp/010vm b/cpp/010vm index a21655ed..abb53732 100644 --- a/cpp/010vm +++ b/cpp/010vm @@ -139,13 +139,15 @@ void setup_recipes() { //: itself. :(before "End One-time Setup") setup_recipes(); +assert(Next_recipe_number < 100); // level 0 is primitives; until 99 +Next_recipe_number = 100; // End Load Recipes // give tests a consistent starting point -assert(Next_recipe_number < 100); -Next_recipe_number = 100; +assert(Next_recipe_number < 1000); +Next_recipe_number = 1000; delete Trace_stream; Trace_stream = new trace_stream; :(before "End Setup") -Next_recipe_number = 100; // consistent new numbers for each test +Next_recipe_number = 1000; // consistent new numbers for each test -- cgit 1.4.1-2-gfad0