From d009e158803956c76adbf8f58a62884c3e7affb3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 26 Jan 2016 23:47:23 -0800 Subject: 2605 --- html/042name.cc.html | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'html/042name.cc.html') diff --git a/html/042name.cc.html b/html/042name.cc.html index 08b875ef..e6f0b296 100644 --- a/html/042name.cc.html +++ b/html/042name.cc.html @@ -13,8 +13,8 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } -.traceContains { color: #008000; } .traceAbsent { color: #c00000; } +.traceContains { color: #008000; } .Identifier { color: #804000; } .cSpecial { color: #008000; } .Constant { color: #00a0a0; } @@ -54,7 +54,7 @@ recipe main [ +error: main: use before set: y # todo: detect conditional defines -:(before "End Instruction Modifying Transforms") +:(after "End Type Modifying Transforms") Transform.push_back(transform_names); // idempotent :(before "End Globals") @@ -80,18 +80,20 @@ void transform_names(const recipe_ordinal r// End transform_names(inst) Special-cases // map names to addresses for (long long int in = 0; in < SIZE(inst.ingredients); ++in) { + if (disqualified(inst.ingredients.at(in), inst, caller.name)) continue; if (is_numeric_location(inst.ingredients.at(in))) numeric_locations_used = true; if (is_named_location(inst.ingredients.at(in))) names_used = true; - if (disqualified(inst.ingredients.at(in), inst, caller.name)) continue; + if (is_integer(inst.ingredients.at(in).name)) continue; if (!already_transformed(inst.ingredients.at(in), names)) { raise_error << maybe(caller.name) << "use before set: " << inst.ingredients.at(in).name << '\n' << end(); } inst.ingredients.at(in).set_value(lookup_name(inst.ingredients.at(in), r)); } for (long long int out = 0; out < SIZE(inst.products); ++out) { + if (disqualified(inst.products.at(out), inst, caller.name)) continue; if (is_numeric_location(inst.products.at(out))) numeric_locations_used = true; if (is_named_location(inst.products.at(out))) names_used = true; - if (disqualified(inst.products.at(out), inst, caller.name)) continue; + if (is_integer(inst.products.at(out).name)) continue; if (names.find(inst.products.at(out).name) == names.end()) { trace(9993, "name") << "assign " << inst.products.at(out).name << " " << curr_idx << end(); names[inst.products.at(out).name] = curr_idx; @@ -106,12 +108,12 @@ void transform_names(const recipe_ordinal r(/*mutable*/ reagent& x, const instruction& inst, const string& recipe_name) { if (!x.type) { + // End transform_names Exceptions raise_error << maybe(recipe_name) << "missing type for " << x.original_string << " in '" << inst.to_string() << "'\n" << end(); return true; } if (is_raw(x)) return true; if (is_literal(x)) return true; - if (is_integer(x.name)) return true; // End Disqualified Reagents if (x.initialized) return true; return false; @@ -126,8 +128,10 @@ long long int lookup_name(const reagent& r} type_ordinal skip_addresses(type_tree* type, const string& recipe_name) { + type_ordinal address = get(Type_ordinal, "address"); + type_ordinal shared = get(Type_ordinal, "shared"); for (; type; type = type->right) { - if (type->value != get(Type_ordinal, "address")) + if (type->value != address && type->value != shared) return type->value; } raise_error << maybe(recipe_name) << "expected a container" << '\n' << end(); @@ -222,7 +226,7 @@ get(Type, point(Type, point).element_names.push_back("y"); :(scenario transform_names_transforms_container_elements) recipe main [ - p:address:point <- copy 0 # unsafe + p:address:point <- copy 0 a:number <- get *p:address:point, y:offset b:number <- get *p:address:point, x:offset ] @@ -266,7 +270,7 @@ recipe main [ 12:number <- copy 1 13:number <- copy 35 14:number <- copy 36 - 20:address:point <- maybe-convert 12:number-or-point/raw, p:variant # unsafe + 20:address:point <- maybe-convert 12:number-or-point/unsafe, p:variant ] +name: variant p of type number-or-point has tag 1 +mem: storing 13 in location 20 -- cgit 1.4.1-2-gfad0