diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-06-17 12:39:09 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-06-17 12:39:09 -0700 |
commit | ab6ed192b75f084a023cde85ba5b2b65e741d966 (patch) | |
tree | 28540a0567ee19b0805831e1e433c65f94ff6c1a | |
parent | dc347ce2d95504a98bb542b48041f516a7f37003 (diff) | |
download | mu-ab6ed192b75f084a023cde85ba5b2b65e741d966.tar.gz |
1585
-rw-r--r-- | 020run.cc | 4 | ||||
-rw-r--r-- | 025trace.cc | 4 | ||||
-rw-r--r-- | 026assert.cc | 2 | ||||
-rw-r--r-- | 027debug.cc | 2 | ||||
-rw-r--r-- | 030container.cc | 4 | ||||
-rw-r--r-- | 031address.cc | 2 | ||||
-rw-r--r-- | 034exclusive_container.cc | 2 | ||||
-rw-r--r-- | 036call_ingredient.cc | 2 | ||||
-rw-r--r-- | 038scheduler.cc | 2 | ||||
-rw-r--r-- | 040brace.cc | 12 | ||||
-rw-r--r-- | 041name.cc | 12 | ||||
-rw-r--r-- | 042new.cc | 6 | ||||
-rw-r--r-- | 045closure_name.cc | 2 | ||||
-rw-r--r-- | 047jump_label.cc | 2 |
14 files changed, 29 insertions, 29 deletions
diff --git a/020run.cc b/020run.cc index 7cc587a8..90413df3 100644 --- a/020run.cc +++ b/020run.cc @@ -177,7 +177,7 @@ void run(string form) { vector<double> read_memory(reagent x) { //? cout << "read_memory: " << x.to_string() << '\n'; //? 2 vector<double> result; - if (isa_literal(x)) { + if (is_literal(x)) { result.push_back(x.value); return result; } @@ -215,7 +215,7 @@ bool is_dummy(const reagent& x) { return x.name == "_"; } -bool isa_literal(const reagent& r) { +bool is_literal(const reagent& r) { return SIZE(r.types) == 1 && r.types.at(0) == 0; } diff --git a/025trace.cc b/025trace.cc index 6a63f369..6052f526 100644 --- a/025trace.cc +++ b/025trace.cc @@ -12,9 +12,9 @@ TRACE, Recipe_number["trace"] = TRACE; :(before "End Primitive Recipe Implementations") case TRACE: { - assert(isa_literal(current_instruction().ingredients.at(0))); + assert(is_literal(current_instruction().ingredients.at(0))); string label = current_instruction().ingredients.at(0).name; - assert(isa_literal(current_instruction().ingredients.at(1))); + assert(is_literal(current_instruction().ingredients.at(1))); string message = current_instruction().ingredients.at(1).name; trace(1, label) << message; break; diff --git a/026assert.cc b/026assert.cc index 74e85496..557bb780 100644 --- a/026assert.cc +++ b/026assert.cc @@ -14,7 +14,7 @@ case ASSERT: { assert(SIZE(ingredients) == 2); assert(scalar(ingredients.at(0))); if (!ingredients.at(0).at(0)) { - assert(isa_literal(current_instruction().ingredients.at(1))); + assert(is_literal(current_instruction().ingredients.at(1))); raise << current_instruction().ingredients.at(1).name << '\n' << die(); } break; diff --git a/027debug.cc b/027debug.cc index 60830bd8..36215244 100644 --- a/027debug.cc +++ b/027debug.cc @@ -7,7 +7,7 @@ Recipe_number["$print"] = _PRINT; :(before "End Primitive Recipe Implementations") case _PRINT: { for (long long int i = 0; i < SIZE(ingredients); ++i) { - if (isa_literal(current_instruction().ingredients.at(i))) { + if (is_literal(current_instruction().ingredients.at(i))) { trace(Primitive_recipe_depth, "run") << "$print: " << current_instruction().ingredients.at(i).name; cout << current_instruction().ingredients.at(i).name; } diff --git a/030container.cc b/030container.cc index 5b150250..e863f92d 100644 --- a/030container.cc +++ b/030container.cc @@ -108,7 +108,7 @@ case GET: { long long int base_address = base.value; type_number base_type = base.types.at(0); assert(Type[base_type].kind == container); - assert(isa_literal(current_instruction().ingredients.at(1))); + assert(is_literal(current_instruction().ingredients.at(1))); assert(scalar(ingredients.at(1))); long long int offset = ingredients.at(1).at(0); long long int src = base_address; @@ -156,7 +156,7 @@ case GET_ADDRESS: { long long int base_address = base.value; type_number base_type = base.types.at(0); assert(Type[base_type].kind == container); - assert(isa_literal(current_instruction().ingredients.at(1))); + assert(is_literal(current_instruction().ingredients.at(1))); assert(scalar(ingredients.at(1))); long long int offset = ingredients.at(1).at(0); long long int result = base_address; diff --git a/031address.cc b/031address.cc index 052eec37..a42965fe 100644 --- a/031address.cc +++ b/031address.cc @@ -27,7 +27,7 @@ x = canonize(x); :(code) reagent canonize(reagent x) { - if (isa_literal(x)) return x; + if (is_literal(x)) return x; //? cout << "canonize\n"; //? 1 reagent r = x; //? cout << x.to_string() << " => " << r.to_string() << '\n'; //? 1 diff --git a/034exclusive_container.cc b/034exclusive_container.cc index 8247cb42..7455cf30 100644 --- a/034exclusive_container.cc +++ b/034exclusive_container.cc @@ -95,7 +95,7 @@ case MAYBE_CONVERT: { long long int base_address = base.value; type_number base_type = base.types.at(0); assert(Type[base_type].kind == exclusive_container); - assert(isa_literal(current_instruction().ingredients.at(1))); + assert(is_literal(current_instruction().ingredients.at(1))); long long int tag = current_instruction().ingredients.at(1).value; long long int result; if (tag == static_cast<long long int>(Memory[base_address])) { diff --git a/036call_ingredient.cc b/036call_ingredient.cc index 33c85e4d..9e355eb1 100644 --- a/036call_ingredient.cc +++ b/036call_ingredient.cc @@ -95,7 +95,7 @@ INGREDIENT, Recipe_number["ingredient"] = INGREDIENT; :(before "End Primitive Recipe Implementations") case INGREDIENT: { - assert(isa_literal(current_instruction().ingredients.at(0))); + assert(is_literal(current_instruction().ingredients.at(0))); assert(scalar(ingredients.at(0))); if (static_cast<long long int>(ingredients.at(0).at(0)) < SIZE(Current_routine->calls.front().ingredient_atoms)) { Current_routine->calls.front().next_ingredient_to_process = ingredients.at(0).at(0); diff --git a/038scheduler.cc b/038scheduler.cc index 3541a141..01eeb27b 100644 --- a/038scheduler.cc +++ b/038scheduler.cc @@ -143,7 +143,7 @@ START_RUNNING, Recipe_number["start-running"] = START_RUNNING; :(before "End Primitive Recipe Implementations") case START_RUNNING: { - assert(isa_literal(current_instruction().ingredients.at(0))); + assert(is_literal(current_instruction().ingredients.at(0))); assert(!current_instruction().ingredients.at(0).initialized); routine* new_routine = new routine(Recipe_number[current_instruction().ingredients.at(0).name]); //? cerr << new_routine->id << " -> " << Current_routine->id << '\n'; //? 1 diff --git a/040brace.cc b/040brace.cc index 9322f3f6..6dd3d4c3 100644 --- a/040brace.cc +++ b/040brace.cc @@ -65,7 +65,7 @@ void transform_braces(const recipe_number r) { ; // do nothing else if (inst.operation == Recipe_number["loop"]) { inst.operation = Recipe_number["jump"]; - if (!inst.ingredients.empty() && isa_literal(inst.ingredients.at(0))) { + if (!inst.ingredients.empty() && is_literal(inst.ingredients.at(0))) { // explicit target; a later phase will handle it trace("after-brace") << "jump " << inst.ingredients.at(0).name << ":offset"; } @@ -81,7 +81,7 @@ void transform_braces(const recipe_number r) { } else if (inst.operation == Recipe_number["break"]) { inst.operation = Recipe_number["jump"]; - if (!inst.ingredients.empty() && isa_literal(inst.ingredients.at(0))) { + if (!inst.ingredients.empty() && is_literal(inst.ingredients.at(0))) { // explicit target; a later phase will handle it trace("after-brace") << "jump " << inst.ingredients.at(0).name << ":offset"; } @@ -95,7 +95,7 @@ void transform_braces(const recipe_number r) { } else if (inst.operation == Recipe_number["loop-if"]) { inst.operation = Recipe_number["jump-if"]; - if (SIZE(inst.ingredients) > 1 && isa_literal(inst.ingredients.at(1))) { + if (SIZE(inst.ingredients) > 1 && is_literal(inst.ingredients.at(1))) { // explicit target; a later phase will handle it trace("after-brace") << "jump " << inst.ingredients.at(1).name << ":offset"; } @@ -109,7 +109,7 @@ void transform_braces(const recipe_number r) { } else if (inst.operation == Recipe_number["break-if"]) { inst.operation = Recipe_number["jump-if"]; - if (SIZE(inst.ingredients) > 1 && isa_literal(inst.ingredients.at(1))) { + if (SIZE(inst.ingredients) > 1 && is_literal(inst.ingredients.at(1))) { // explicit target; a later phase will handle it trace("after-brace") << "jump " << inst.ingredients.at(1).name << ":offset"; } @@ -123,7 +123,7 @@ void transform_braces(const recipe_number r) { } else if (inst.operation == Recipe_number["loop-unless"]) { inst.operation = Recipe_number["jump-unless"]; - if (SIZE(inst.ingredients) > 1 && isa_literal(inst.ingredients.at(1))) { + if (SIZE(inst.ingredients) > 1 && is_literal(inst.ingredients.at(1))) { // explicit target; a later phase will handle it trace("after-brace") << "jump " << inst.ingredients.at(1).name << ":offset"; } @@ -138,7 +138,7 @@ void transform_braces(const recipe_number r) { else if (inst.operation == Recipe_number["break-unless"]) { //? cout << "AAA break-unless\n"; //? 1 inst.operation = Recipe_number["jump-unless"]; - if (SIZE(inst.ingredients) > 1 && isa_literal(inst.ingredients.at(1))) { + if (SIZE(inst.ingredients) > 1 && is_literal(inst.ingredients.at(1))) { // explicit target; a later phase will handle it trace("after-brace") << "jump " << inst.ingredients.at(1).name << ":offset"; } diff --git a/041name.cc b/041name.cc index c3bd49fa..542f0f4d 100644 --- a/041name.cc +++ b/041name.cc @@ -67,7 +67,7 @@ void transform_names(const recipe_number r) { } void check_metadata(map<string, vector<type_number> >& metadata, const reagent& x, const recipe_number r) { - if (isa_literal(x)) return; + if (is_literal(x)) return; if (is_raw(x)) return; if (metadata.find(x.name) == metadata.end()) metadata[x.name] = x.types; @@ -81,7 +81,7 @@ bool disqualified(/*mutable*/ reagent& x) { raise << "missing type in " << x.to_string() << '\n'; assert(!x.types.empty()); if (is_raw(x)) return true; - if (isa_literal(x)) return true; + if (is_literal(x)) return true; if (is_integer(x.name)) return true; // End Disqualified Reagents if (x.initialized) return true; @@ -115,14 +115,14 @@ int find_element_name(const type_number t, const string& name) { } bool is_numeric_location(const reagent& x) { - if (isa_literal(x)) return false; + if (is_literal(x)) return false; if (is_raw(x)) return false; if (x.name == "0") return false; // used for chaining lexical scopes return is_integer(x.name); } bool is_named_location(const reagent& x) { - if (isa_literal(x)) return false; + if (is_literal(x)) return false; if (is_raw(x)) return false; if (is_special_name(x.name)) return false; return !is_integer(x.name); @@ -223,7 +223,7 @@ if (inst.operation == Recipe_number["get"] // at least 2 args, and second arg is offset assert(SIZE(inst.ingredients) >= 2); //? cout << inst.ingredients.at(1).to_string() << '\n'; //? 1 - assert(isa_literal(inst.ingredients.at(1))); + assert(is_literal(inst.ingredients.at(1))); if (inst.ingredients.at(1).name.find_first_not_of("0123456789") == string::npos) continue; // since first non-address in base type must be a container, we don't have to canonize type_number base_type = skip_addresses(inst.ingredients.at(0).types); @@ -259,7 +259,7 @@ recipe main [ if (inst.operation == Recipe_number["maybe-convert"]) { // at least 2 args, and second arg is offset assert(SIZE(inst.ingredients) >= 2); - assert(isa_literal(inst.ingredients.at(1))); + assert(is_literal(inst.ingredients.at(1))); if (inst.ingredients.at(1).name.find_first_not_of("0123456789") == string::npos) continue; // since first non-address in base type must be an exclusive container, we don't have to canonize type_number base_type = skip_addresses(inst.ingredients.at(0).types); diff --git a/042new.cc b/042new.cc index facb9420..7d05ef19 100644 --- a/042new.cc +++ b/042new.cc @@ -35,7 +35,7 @@ if (inst.operation == Recipe_number["new"]) { // End NEW Transform Special-cases // first arg must be of type 'type' assert(SIZE(inst.ingredients) >= 1); - assert(isa_literal(inst.ingredients.at(0))); + assert(is_literal(inst.ingredients.at(0))); if (inst.ingredients.at(0).properties.at(0).second.at(0) != "type") raise << "tried to allocate non-type " << inst.ingredients.at(0).to_string() << " in recipe " << Recipe[r].name << '\n' << die(); if (Type_number.find(inst.ingredients.at(0).name) == Type_number.end()) @@ -60,7 +60,7 @@ case NEW: { long long int array_length = 0; { vector<type_number> type; - assert(isa_literal(current_instruction().ingredients.at(0))); + assert(is_literal(current_instruction().ingredients.at(0))); type.push_back(current_instruction().ingredients.at(0).value); //? trace(Primitive_recipe_depth, "mem") << "type " << current_instruction().ingredients.at(0).to_string() << ' ' << type.size() << ' ' << type.back() << " has size " << size_of(type); //? 1 if (SIZE(current_instruction().ingredients) > 1) { @@ -187,7 +187,7 @@ recipe main [ } :(after "case NEW" following "Primitive Recipe Implementations") -if (isa_literal(current_instruction().ingredients.at(0)) +if (is_literal(current_instruction().ingredients.at(0)) && current_instruction().ingredients.at(0).properties.at(0).second.at(0) == "literal-string") { // allocate an array just large enough for it long long int string_length = unicode_length(current_instruction().ingredients.at(0).name); diff --git a/045closure_name.cc b/045closure_name.cc index 66696fc6..dd19c52e 100644 --- a/045closure_name.cc +++ b/045closure_name.cc @@ -46,7 +46,7 @@ void collect_surrounding_spaces(const recipe_number r) { const instruction& inst = Recipe[r].steps.at(i); if (inst.is_label) continue; for (long long int j = 0; j < SIZE(inst.products); ++j) { - if (isa_literal(inst.products.at(j))) continue; + if (is_literal(inst.products.at(j))) continue; if (inst.products.at(j).name != "0") continue; if (SIZE(inst.products.at(j).types) != 3 || inst.products.at(j).types.at(0) != Type_number["address"] diff --git a/047jump_label.cc b/047jump_label.cc index 73de08dd..ca7f868c 100644 --- a/047jump_label.cc +++ b/047jump_label.cc @@ -47,7 +47,7 @@ void transform_labels(const recipe_number r) { :(code) void replace_offset(reagent& x, /*const*/ map<string, long long int>& offset, const long long int current_offset, const recipe_number r) { //? cerr << "AAA " << x.to_string() << '\n'; //? 1 - assert(isa_literal(x)); + assert(is_literal(x)); //? cerr << "BBB " << x.to_string() << '\n'; //? 1 assert(!x.initialized); //? cerr << "CCC " << x.to_string() << '\n'; //? 1 |