about summary refs log tree commit diff stats
path: root/011load.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-08-16 19:13:45 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-08-16 19:13:45 -0700
commit5db2faebe215e588172bcfe1810416f4c7b909b1 (patch)
tree996db049f328a428b9e5478d9f6d3203ec6fb8a7 /011load.cc
parent221caac6150a60077f168002b37f6e1692dcc163 (diff)
downloadmu-5db2faebe215e588172bcfe1810416f4c7b909b1.tar.gz
2022 - run sandboxes in separate routines
Diffstat (limited to '011load.cc')
-rw-r--r--011load.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/011load.cc b/011load.cc
index 5f172aae..301dfdf2 100644
--- a/011load.cc
+++ b/011load.cc
@@ -27,7 +27,7 @@ vector<recipe_ordinal> load(istream& in) {
     // Command Handlers
     if (command == "recipe") {
       string recipe_name = next_word(in);
-//?       cerr << "recipe: " << recipe_name << '\n'; //? 1
+//?       cerr << "recipe: " << recipe_name << '\n'; //? 2
       if (recipe_name.empty())
         raise << "empty recipe name\n" << end();
       if (Recipe_ordinal.find(recipe_name) == Recipe_ordinal.end()) {
@@ -39,7 +39,7 @@ vector<recipe_ordinal> load(istream& in) {
       }
       // todo: save user-defined recipes to mu's memory
       Recipe[Recipe_ordinal[recipe_name]] = slurp_recipe(in);
-//?       cerr << Recipe_ordinal[recipe_name] << ": " << recipe_name << '\n'; //? 1
+//?       cerr << Recipe_ordinal[recipe_name] << ": " << recipe_name << '\n'; //? 2
       Recipe[Recipe_ordinal[recipe_name]].name = recipe_name;
       // track added recipes because we may need to undo them in tests; see below
       recently_added_recipes.push_back(Recipe_ordinal[recipe_name]);
@@ -234,7 +234,8 @@ vector<recipe_ordinal> recently_added_recipes;
 :(before "End Setup")
 for (long long int i = 0; i < SIZE(recently_added_recipes); ++i) {
 //?   cout << "AAA clearing " << Recipe[recently_added_recipes.at(i)].name << '\n'; //? 2
-  Recipe_ordinal.erase(Recipe[recently_added_recipes.at(i)].name);
+  if (recently_added_recipes.at(i) >= Reserved_for_tests)  // don't renumber existing recipes, like 'interactive'
+    Recipe_ordinal.erase(Recipe[recently_added_recipes.at(i)].name);
   Recipe.erase(recently_added_recipes.at(i));
 }
 // Clear Other State For recently_added_recipes