2656
This commit is contained in:
parent
3965ca030f
commit
996a8acd6c
|
@ -555,6 +555,7 @@ Transform.push_back(check_or_set_invalid_types); // idempotent
|
|||
:(code)
|
||||
void check_or_set_invalid_types(const recipe_ordinal r) {
|
||||
recipe& caller = get(Recipe, r);
|
||||
trace(9991, "transform") << "--- check for invalid types in recipe " << caller.name << end();
|
||||
for (long long int index = 0; index < SIZE(caller.steps); ++index) {
|
||||
instruction& inst = caller.steps.at(index);
|
||||
for (long long int i = 0; i < SIZE(inst.ingredients); ++i) {
|
||||
|
|
|
@ -65,6 +65,7 @@ Transform.push_back(check_types_of_reply_instructions);
|
|||
:(code)
|
||||
void check_types_of_reply_instructions(recipe_ordinal r) {
|
||||
const recipe& caller = get(Recipe, r);
|
||||
trace(9991, "transform") << "--- check types of reply instructions in recipe " << caller.name << end();
|
||||
for (long long int i = 0; i < SIZE(caller.steps); ++i) {
|
||||
const instruction& caller_instruction = caller.steps.at(i);
|
||||
if (caller_instruction.is_label) continue;
|
||||
|
|
|
@ -7,6 +7,7 @@ Transform.push_back(rewrite_stashes_to_text);
|
|||
:(code)
|
||||
void rewrite_stashes_to_text(recipe_ordinal r) {
|
||||
recipe& caller = get(Recipe, r);
|
||||
trace(9991, "transform") << "--- rewrite 'stash' instructions in recipe " << caller.name << end();
|
||||
if (contains_named_locations(caller))
|
||||
rewrite_stashes_to_text_named(caller);
|
||||
// in recipes without named locations, 'stash' is still not extensible
|
||||
|
|
|
@ -152,11 +152,10 @@ void check_immutable_ingredients(recipe_ordinal r) {
|
|||
// call get-address or index-address with it, and that any non-primitive
|
||||
// recipe calls in the body aren't returning it as a product.
|
||||
const recipe& caller = get(Recipe, r);
|
||||
//? cerr << caller.name << '\n';
|
||||
trace(9991, "transform") << "--- check mutability of ingredients in recipe " << caller.name << end();
|
||||
if (!caller.has_header) return; // skip check for old-style recipes calling next-ingredient directly
|
||||
for (long long int i = 0; i < SIZE(caller.ingredients); ++i) {
|
||||
const reagent& current_ingredient = caller.ingredients.at(i);
|
||||
//? cerr << " " << current_ingredient.original_string << '\n';
|
||||
if (!is_mu_address(current_ingredient)) continue; // will be copied
|
||||
if (is_present_in_products(caller, current_ingredient.name)) continue; // not expected to be immutable
|
||||
// End Immutable Ingredients Special-cases
|
||||
|
@ -164,7 +163,6 @@ void check_immutable_ingredients(recipe_ordinal r) {
|
|||
immutable_vars.insert(current_ingredient.name);
|
||||
for (long long int i = 0; i < SIZE(caller.steps); ++i) {
|
||||
const instruction& inst = caller.steps.at(i);
|
||||
//? cerr << " " << inst.to_string() << '\n';
|
||||
check_immutable_ingredient_in_instruction(inst, immutable_vars, current_ingredient.name, caller);
|
||||
update_aliases(inst, immutable_vars);
|
||||
}
|
||||
|
@ -238,7 +236,6 @@ void check_immutable_ingredient_in_instruction(const instruction& inst, const se
|
|||
if (current_ingredient_indices.empty()) return; // ingredient not found in call
|
||||
for (set<long long int>::iterator p = current_ingredient_indices.begin(); p != current_ingredient_indices.end(); ++p) {
|
||||
const long long int current_ingredient_index = *p;
|
||||
//? cerr << " ingredient index: " << *p << '\n';
|
||||
reagent current_ingredient = inst.ingredients.at(current_ingredient_index);
|
||||
canonize_type(current_ingredient);
|
||||
const string& current_ingredient_name = current_ingredient.name;
|
||||
|
|
Loading…
Reference in New Issue
Block a user