From acc4792d2f7c787aad064876a1eb2d00bdf076b2 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 21 Mar 2016 02:25:52 -0700 Subject: 2803 Show more thorough information about instructions in the trace, but keep the original form in error messages. --- 032array.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to '032array.cc') diff --git a/032array.cc b/032array.cc index b7fa44b0..0fd1d0a4 100644 --- a/032array.cc +++ b/032array.cc @@ -20,7 +20,7 @@ put(Recipe_ordinal, "create-array", CREATE_ARRAY); :(before "End Primitive Recipe Checks") case CREATE_ARRAY: { if (inst.products.empty()) { - raise << maybe(get(Recipe, r).name) << "'create-array' needs one product and no ingredients but got '" << to_string(inst) << '\n' << end(); + raise << maybe(get(Recipe, r).name) << "'create-array' needs one product and no ingredients but got '" << to_original_string(inst) << '\n' << end(); break; } reagent product = inst.products.at(0); @@ -30,12 +30,12 @@ case CREATE_ARRAY: { break; } if (!product.type->right) { - raise << maybe(get(Recipe, r).name) << "create array of what? " << to_string(inst) << '\n' << end(); + raise << maybe(get(Recipe, r).name) << "create array of what? " << to_original_string(inst) << '\n' << end(); break; } // 'create-array' will need to check properties rather than types if (!product.type->right->right) { - raise << maybe(get(Recipe, r).name) << "create array of what size? " << to_string(inst) << '\n' << end(); + raise << maybe(get(Recipe, r).name) << "create array of what size? " << to_original_string(inst) << '\n' << end(); break; } if (!is_integer(product.type->right->right->name)) { @@ -176,7 +176,7 @@ put(Recipe_ordinal, "index", INDEX); :(before "End Primitive Recipe Checks") case INDEX: { if (SIZE(inst.ingredients) != 2) { - raise << maybe(get(Recipe, r).name) << "'index' expects exactly 2 ingredients in '" << to_string(inst) << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'index' expects exactly 2 ingredients in '" << to_original_string(inst) << "'\n" << end(); break; } reagent base = inst.ingredients.at(0); @@ -203,7 +203,7 @@ case INDEX: { int base_address = base.value; trace(9998, "run") << "base address is " << base_address << end(); if (base_address == 0) { - raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); break; } reagent offset = current_instruction().ingredients.at(1); @@ -320,7 +320,7 @@ put(Recipe_ordinal, "index-address", INDEX_ADDRESS); :(before "End Primitive Recipe Checks") case INDEX_ADDRESS: { if (SIZE(inst.ingredients) != 2) { - raise << maybe(get(Recipe, r).name) << "'index-address' expects exactly 2 ingredients in '" << to_string(inst) << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'index-address' expects exactly 2 ingredients in '" << to_original_string(inst) << "'\n" << end(); break; } reagent base = inst.ingredients.at(0); @@ -347,7 +347,7 @@ case INDEX_ADDRESS: { canonize(base); int base_address = base.value; if (base_address == 0) { - raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); break; } reagent offset = current_instruction().ingredients.at(1); @@ -428,7 +428,7 @@ put(Recipe_ordinal, "length", LENGTH); :(before "End Primitive Recipe Checks") case LENGTH: { if (SIZE(inst.ingredients) != 1) { - raise << maybe(get(Recipe, r).name) << "'length' expects exactly 2 ingredients in '" << to_string(inst) << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'length' expects exactly 2 ingredients in '" << to_original_string(inst) << "'\n" << end(); break; } reagent x = inst.ingredients.at(0); @@ -444,7 +444,7 @@ case LENGTH: { reagent x = current_instruction().ingredients.at(0); canonize(x); if (x.value == 0) { - raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); break; } products.resize(1); -- cgit 1.4.1-2-gfad0 f='#n45'>45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129