From 363be37f3f41db063ced940e310d6bba6ef82ef3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 4 Jul 2015 09:40:50 -0700 Subject: 1702 - experiment: start using 'ordinal' in names It comes up pretty early in the codebase, but hopefully won't come up in the mu level until we get to higher-order recipes. Potentially intimidating name, but such prime real estate with no confusing overloadings in other projects! --- 042new.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to '042new.cc') diff --git a/042new.cc b/042new.cc index 0e685095..59337300 100644 --- a/042new.cc +++ b/042new.cc @@ -28,10 +28,10 @@ trace(Primitive_recipe_depth, "new") << "routine allocated memory from " << allo //:: First handle 'type' operands. :(before "End Mu Types Initialization") -Type_number["type"] = 0; +Type_ordinal["type"] = 0; :(after "Per-recipe Transforms") -// replace type names with type_numbers -if (inst.operation == Recipe_number["new"]) { +// replace type names with type_ordinals +if (inst.operation == Recipe_ordinal["new"]) { // End NEW Transform Special-cases // first arg must be of type 'type' assert(SIZE(inst.ingredients) >= 1); @@ -39,10 +39,10 @@ if (inst.operation == Recipe_number["new"]) { raise << "expected literal, got " << inst.ingredients.at(0).to_string() << '\n' << die(); if (inst.ingredients.at(0).properties.at(0).second.at(0) != "type") raise << "tried to allocate non-type " << inst.ingredients.at(0).to_string() << " in recipe " << Recipe[r].name << '\n' << die(); - if (Type_number.find(inst.ingredients.at(0).name) == Type_number.end()) + if (Type_ordinal.find(inst.ingredients.at(0).name) == Type_ordinal.end()) raise << "unknown type " << inst.ingredients.at(0).name << " in recipe " << Recipe[r].name << '\n' << die(); -//? cerr << "type " << inst.ingredients.at(0).name << " => " << Type_number[inst.ingredients.at(0).name] << '\n'; //? 1 - inst.ingredients.at(0).set_value(Type_number[inst.ingredients.at(0).name]); +//? cerr << "type " << inst.ingredients.at(0).name << " => " << Type_ordinal[inst.ingredients.at(0).name] << '\n'; //? 1 + inst.ingredients.at(0).set_value(Type_ordinal[inst.ingredients.at(0).name]); trace(Primitive_recipe_depth, "new") << inst.ingredients.at(0).name << " -> " << inst.ingredients.at(0).name; end_new_transform:; } @@ -53,14 +53,14 @@ if (inst.operation == Recipe_number["new"]) { :(before "End Primitive Recipe Declarations") NEW, :(before "End Primitive Recipe Numbers") -Recipe_number["new"] = NEW; +Recipe_ordinal["new"] = NEW; :(before "End Primitive Recipe Implementations") case NEW: { // compute the space we need long long int size = 0; long long int array_length = 0; { - vector type; + vector type; assert(is_literal(current_instruction().ingredients.at(0))); type.push_back(current_instruction().ingredients.at(0).value); //? trace(Primitive_recipe_depth, "mem") << "type " << current_instruction().ingredients.at(0).to_string() << ' ' << type.size() << ' ' << type.back() << " has size " << size_of(type); //? 1 -- cgit 1.4.1-2-gfad0