diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-06 22:15:45 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-06 22:15:45 -0700 |
commit | 5f98a10cc78829a03c9fa5a137392e7d5e9030ac (patch) | |
tree | b88536e28f6d507c4b68b337423c0b6a4e28306c /025compare.cc | |
parent | 75aa3a98e2b9311d65df91523ec754d5a2770456 (diff) | |
download | mu-5f98a10cc78829a03c9fa5a137392e7d5e9030ac.tar.gz |
2258 - separate warnings from errors
At the lowest level I'm reluctantly starting to see the need for errors that stop the program in its tracks. Only way to avoid memory corruption and security issues. But beyond that core I still want to be as lenient as possible at higher levels of abstraction.
Diffstat (limited to '025compare.cc')
-rw-r--r-- | 025compare.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/025compare.cc b/025compare.cc index 74f1e4f1..f7acb64c 100644 --- a/025compare.cc +++ b/025compare.cc @@ -7,7 +7,7 @@ Recipe_ordinal["equal"] = EQUAL; :(before "End Primitive Recipe Checks") case EQUAL: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(Recipe[r].name) << "'equal' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); + raise_error << maybe(Recipe[r].name) << "'equal' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); break; } break; @@ -66,12 +66,12 @@ Recipe_ordinal["greater-than"] = GREATER_THAN; :(before "End Primitive Recipe Checks") case GREATER_THAN: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(Recipe[r].name) << "'greater-than' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); + raise_error << maybe(Recipe[r].name) << "'greater-than' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); break; } for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_number(inst.ingredients.at(i))) { - raise << maybe(Recipe[r].name) << "'greater-than' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); + raise_error << maybe(Recipe[r].name) << "'greater-than' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); goto finish_checking_instruction; } } @@ -125,12 +125,12 @@ Recipe_ordinal["lesser-than"] = LESSER_THAN; :(before "End Primitive Recipe Checks") case LESSER_THAN: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(Recipe[r].name) << "'lesser-than' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); + raise_error << maybe(Recipe[r].name) << "'lesser-than' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); break; } for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_number(inst.ingredients.at(i))) { - raise << maybe(Recipe[r].name) << "'lesser-than' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); + raise_error << maybe(Recipe[r].name) << "'lesser-than' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); goto finish_checking_instruction; } } @@ -184,12 +184,12 @@ Recipe_ordinal["greater-or-equal"] = GREATER_OR_EQUAL; :(before "End Primitive Recipe Checks") case GREATER_OR_EQUAL: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(Recipe[r].name) << "'greater-or-equal' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); + raise_error << maybe(Recipe[r].name) << "'greater-or-equal' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); break; } for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_number(inst.ingredients.at(i))) { - raise << maybe(Recipe[r].name) << "'greater-or-equal' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); + raise_error << maybe(Recipe[r].name) << "'greater-or-equal' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); goto finish_checking_instruction; } } @@ -251,12 +251,12 @@ Recipe_ordinal["lesser-or-equal"] = LESSER_OR_EQUAL; :(before "End Primitive Recipe Checks") case LESSER_OR_EQUAL: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(Recipe[r].name) << "'lesser-or-equal' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); + raise_error << maybe(Recipe[r].name) << "'lesser-or-equal' needs at least two ingredients to compare in '" << inst.to_string() << "'\n" << end(); break; } for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_number(inst.ingredients.at(i))) { - raise << maybe(Recipe[r].name) << "'lesser-or-equal' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); + raise_error << maybe(Recipe[r].name) << "'lesser-or-equal' can only compare numbers; got " << inst.ingredients.at(i).original_string << '\n' << end(); goto finish_checking_instruction; } } |