From 363be37f3f41db063ced940e310d6bba6ef82ef3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 4 Jul 2015 09:40:50 -0700 Subject: 1702 - experiment: start using 'ordinal' in names It comes up pretty early in the codebase, but hopefully won't come up in the mu level until we get to higher-order recipes. Potentially intimidating name, but such prime real estate with no confusing overloadings in other projects! --- 047jump_label.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to '047jump_label.cc') diff --git a/047jump_label.cc b/047jump_label.cc index ca7f868c..dca2e37a 100644 --- a/047jump_label.cc +++ b/047jump_label.cc @@ -11,13 +11,13 @@ recipe main [ -mem: storing 0 in location 1 :(before "End Mu Types Initialization") -Type_number["label"] = 0; +Type_ordinal["label"] = 0; :(after "int main") Transform.push_back(transform_labels); :(code) -void transform_labels(const recipe_number r) { +void transform_labels(const recipe_ordinal r) { map offset; for (long long int i = 0; i < SIZE(Recipe[r].steps); ++i) { const instruction& inst = Recipe[r].steps.at(i); @@ -25,19 +25,19 @@ void transform_labels(const recipe_number r) { } for (long long int i = 0; i < SIZE(Recipe[r].steps); ++i) { instruction& inst = Recipe[r].steps.at(i); - if (inst.operation == Recipe_number["jump"]) { + if (inst.operation == Recipe_ordinal["jump"]) { //? cerr << inst.to_string() << '\n'; //? 1 replace_offset(inst.ingredients.at(0), offset, i, r); } - if (inst.operation == Recipe_number["jump-if"] || inst.operation == Recipe_number["jump-unless"]) { + if (inst.operation == Recipe_ordinal["jump-if"] || inst.operation == Recipe_ordinal["jump-unless"]) { replace_offset(inst.ingredients.at(1), offset, i, r); } - if ((inst.operation == Recipe_number["loop"] || inst.operation == Recipe_number["break"]) + if ((inst.operation == Recipe_ordinal["loop"] || inst.operation == Recipe_ordinal["break"]) && SIZE(inst.ingredients) == 1) { replace_offset(inst.ingredients.at(0), offset, i, r); } - if ((inst.operation == Recipe_number["loop-if"] || inst.operation == Recipe_number["loop-unless"] - || inst.operation == Recipe_number["break-if"] || inst.operation == Recipe_number["break-unless"]) + if ((inst.operation == Recipe_ordinal["loop-if"] || inst.operation == Recipe_ordinal["loop-unless"] + || inst.operation == Recipe_ordinal["break-if"] || inst.operation == Recipe_ordinal["break-unless"]) && SIZE(inst.ingredients) == 2) { replace_offset(inst.ingredients.at(1), offset, i, r); } @@ -45,7 +45,7 @@ void transform_labels(const recipe_number r) { } :(code) -void replace_offset(reagent& x, /*const*/ map& offset, const long long int current_offset, const recipe_number r) { +void replace_offset(reagent& x, /*const*/ map& offset, const long long int current_offset, const recipe_ordinal r) { //? cerr << "AAA " << x.to_string() << '\n'; //? 1 assert(is_literal(x)); //? cerr << "BBB " << x.to_string() << '\n'; //? 1 -- cgit 1.4.1-2-gfad0