diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-09-30 02:01:59 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-09-30 02:01:59 -0700 |
commit | e236973be09620daec70d83f7a5846e8f6fff680 (patch) | |
tree | 0de608da6bbad2b019c548788af24607f535c1bd | |
parent | 4e49b29e63b0d369b81318ac822dc06ce06786b5 (diff) | |
download | mu-e236973be09620daec70d83f7a5846e8f6fff680.tar.gz |
2222
-rw-r--r-- | 021check_instruction.cc (renamed from 021check_type_by_instruction.cc) | 12 | ||||
-rw-r--r-- | 022arithmetic.cc | 10 | ||||
-rw-r--r-- | 023boolean.cc | 6 |
3 files changed, 14 insertions, 14 deletions
diff --git a/021check_type_by_instruction.cc b/021check_instruction.cc index b5fb8197..a9ed55b2 100644 --- a/021check_type_by_instruction.cc +++ b/021check_instruction.cc @@ -3,16 +3,16 @@ //: recipes as we extend 'run' to support them. :(after "int main") - Transform.push_back(check_types_by_instruction); + Transform.push_back(check_instruction); :(code) -void check_types_by_instruction(const recipe_ordinal r) { +void check_instruction(const recipe_ordinal r) { if (Trace_stream && trace_count("warn") > 0) return; map<string, vector<type_ordinal> > metadata; for (long long int i = 0; i < SIZE(Recipe[r].steps); ++i) { instruction& inst = Recipe[r].steps.at(i); switch (inst.operation) { - // Primitive Recipe Type Checks + // Primitive Recipe Checks case COPY: { if (SIZE(inst.products) != SIZE(inst.ingredients)) { raise << "ingredients and products should match in '" << inst.to_string() << "'\n" << end(); @@ -26,10 +26,10 @@ void check_types_by_instruction(const recipe_ordinal r) { } break; } - // End Primitive Recipe Type Checks + // End Primitive Recipe Checks default: { - // Defined Recipe Type Checks - // End Defined Recipe Type Checks + // Defined Recipe Checks + // End Defined Recipe Checks } } finish_checking_instruction:; diff --git a/022arithmetic.cc b/022arithmetic.cc index 66aefbc8..dc06a46a 100644 --- a/022arithmetic.cc +++ b/022arithmetic.cc @@ -4,7 +4,7 @@ ADD, :(before "End Primitive Recipe Numbers") Recipe_ordinal["add"] = ADD; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case ADD: { // primary goal of these checks is to forbid address arithmetic for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { @@ -72,7 +72,7 @@ recipe main [ SUBTRACT, :(before "End Primitive Recipe Numbers") Recipe_ordinal["subtract"] = SUBTRACT; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case SUBTRACT: { if (inst.ingredients.empty()) { raise << Recipe[r].name << ": 'subtract' has no ingredients\n" << end(); @@ -129,7 +129,7 @@ recipe main [ MULTIPLY, :(before "End Primitive Recipe Numbers") Recipe_ordinal["multiply"] = MULTIPLY; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case MULTIPLY: { for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_number(inst.ingredients.at(i))) { @@ -182,7 +182,7 @@ recipe main [ DIVIDE, :(before "End Primitive Recipe Numbers") Recipe_ordinal["divide"] = DIVIDE; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case DIVIDE: { if (inst.ingredients.empty()) { raise << Recipe[r].name << ": 'divide' has no ingredients\n" << end(); @@ -240,7 +240,7 @@ recipe main [ DIVIDE_WITH_REMAINDER, :(before "End Primitive Recipe Numbers") Recipe_ordinal["divide-with-remainder"] = DIVIDE_WITH_REMAINDER; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case DIVIDE_WITH_REMAINDER: { if (SIZE(inst.ingredients) != 2) { raise << current_recipe_name() << ": 'divide-with-remainder' requires exactly two ingredients, but got '" << current_instruction().to_string() << "'\n" << end(); diff --git a/023boolean.cc b/023boolean.cc index b0debe6b..e556f47c 100644 --- a/023boolean.cc +++ b/023boolean.cc @@ -4,7 +4,7 @@ AND, :(before "End Primitive Recipe Numbers") Recipe_ordinal["and"] = AND; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case AND: { for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_scalar(inst.ingredients.at(i))) { @@ -54,7 +54,7 @@ recipe main [ OR, :(before "End Primitive Recipe Numbers") Recipe_ordinal["or"] = OR; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case OR: { for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_scalar(inst.ingredients.at(i))) { @@ -104,7 +104,7 @@ recipe main [ NOT, :(before "End Primitive Recipe Numbers") Recipe_ordinal["not"] = NOT; -:(before "End Primitive Recipe Type Checks") +:(before "End Primitive Recipe Checks") case NOT: { if (SIZE(inst.products) > SIZE(inst.ingredients)) { raise << Recipe[r].name << ": 'not' cannot have fewer ingredients than products in '" << inst.to_string() << "'\n" << end(); |