From 8d72e5652147a0218f36757fd9171f3f2beda887 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 21 Jul 2016 19:22:03 -0700 Subject: 3120 Always show instruction before any transforms in error messages. This is likely going to make some errors unclear because they *need* to show the original instruction. But if we don't have tests for those situations did they ever really work? --- 042name.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '042name.cc') diff --git a/042name.cc b/042name.cc index 323e9c3e..6c122935 100644 --- a/042name.cc +++ b/042name.cc @@ -95,7 +95,7 @@ void transform_names(const recipe_ordinal r) { bool is_disqualified(/*mutable*/ reagent& x, const instruction& inst, const string& recipe_name) { if (!x.type) { // End Null-type is_disqualified Exceptions - raise << maybe(recipe_name) << "missing type for '" << x.original_string << "' in '" << to_original_string(inst) << "'\n" << end(); + raise << maybe(recipe_name) << "missing type for '" << x.original_string << "' in '" << inst.original_string << "'\n" << end(); return true; } if (is_raw(x)) return true; @@ -281,7 +281,7 @@ def main [ // convert variant names of exclusive containers if (inst.name == "maybe-convert") { if (SIZE(inst.ingredients) != 2) { - raise << maybe(get(Recipe, r).name) << "exactly 2 ingredients expected in '" << to_original_string(inst) << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "exactly 2 ingredients expected in '" << inst.original_string << "'\n" << end(); break; } assert(is_literal(inst.ingredients.at(1))); @@ -289,7 +289,7 @@ if (inst.name == "maybe-convert") { // since first non-address in base type must be an exclusive container, we don't have to canonize type_ordinal base_type = skip_addresses(inst.ingredients.at(0).type); if (base_type == -1) - raise << maybe(get(Recipe, r).name) << "expected an exclusive-container in '" << to_original_string(inst) << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "expected an exclusive-container in '" << inst.original_string << "'\n" << end(); if (contains_key(Type, base_type)) { // otherwise we'll raise an error elsewhere inst.ingredients.at(1).set_value(find_element_name(base_type, inst.ingredients.at(1).name, get(Recipe, r).name)); trace(9993, "name") << "variant " << inst.ingredients.at(1).name << " of type " << get(Type, base_type).name << " has tag " << no_scientific(inst.ingredients.at(1).value) << end(); -- cgit 1.4.1-2-gfad0 e/relayout?h=main&id=34c274107a81cfc6abb8786db810593f9365a950'>relayout
blob: e5f9a164f649c035ec529095cc9e1965714dbbe4 (plain) (tree)
1
2
3
4
5
6