From 5a9520332a70f8d2e86bc3564bcd4bffde182e87 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 12 Apr 2015 22:34:59 -0700 Subject: 1054 --- cpp/.traces/first_scenario_in_mu | 11 +++++++++++ cpp/032trace | 21 --------------------- cpp/033trace | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 cpp/.traces/first_scenario_in_mu delete mode 100644 cpp/032trace create mode 100644 cpp/033trace diff --git a/cpp/.traces/first_scenario_in_mu b/cpp/.traces/first_scenario_in_mu new file mode 100644 index 00000000..3b12bb71 --- /dev/null +++ b/cpp/.traces/first_scenario_in_mu @@ -0,0 +1,11 @@ +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: "1", value: 0, type: 1, properties: ["1": "integer"]} +after-brace/0: recipe test-first_scenario_in_mu +after-brace/0: add ... +run/0: instruction test-first_scenario_in_mu/0 +run/0: ingredient 0 is 2 +run/0: ingredient 1 is 2 +run/0: product 0 is 4 +mem/0: storing 4 in location 1 diff --git a/cpp/032trace b/cpp/032trace deleted file mode 100644 index 3a7b0b0e..00000000 --- a/cpp/032trace +++ /dev/null @@ -1,21 +0,0 @@ -:(scenario "trace") -recipe main [ - trace [foo], [this is a trace in mu] -] -+foo: this is a trace in mu - -:(before "End Globals") -const int TRACE = 32; -:(before "End Primitive Recipe Numbers") -Recipe_number["trace"] = TRACE; -assert(Next_recipe_number == TRACE); -Next_recipe_number++; -:(before "End Primitive Recipe Implementations") -case TRACE: { - assert(isa_literal(instructions[pc].ingredients[0])); - string label = instructions[pc].ingredients[0].name; - assert(isa_literal(instructions[pc].ingredients[1])); - string message = instructions[pc].ingredients[1].name; - trace(label) << message; - break; -} diff --git a/cpp/033trace b/cpp/033trace new file mode 100644 index 00000000..3a7b0b0e --- /dev/null +++ b/cpp/033trace @@ -0,0 +1,21 @@ +:(scenario "trace") +recipe main [ + trace [foo], [this is a trace in mu] +] ++foo: this is a trace in mu + +:(before "End Globals") +const int TRACE = 32; +:(before "End Primitive Recipe Numbers") +Recipe_number["trace"] = TRACE; +assert(Next_recipe_number == TRACE); +Next_recipe_number++; +:(before "End Primitive Recipe Implementations") +case TRACE: { + assert(isa_literal(instructions[pc].ingredients[0])); + string label = instructions[pc].ingredients[0].name; + assert(isa_literal(instructions[pc].ingredients[1])); + string message = instructions[pc].ingredients[1].name; + trace(label) << message; + break; +} -- cgit 1.4.1-2-gfad0