diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-25 21:42:18 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-25 21:42:18 -0700 |
commit | c6034af30882b6a0a38bcf1fe546ed3dfd3bed04 (patch) | |
tree | d63634d44163ad21ddbbabf9a9386adf697a7aa2 /011load.cc | |
parent | f5dfb7f7374c7e78575d0c205db391814be1b434 (diff) | |
download | mu-c6034af30882b6a0a38bcf1fe546ed3dfd3bed04.tar.gz |
2277 - reagents now have a tree of types
Diffstat (limited to '011load.cc')
-rw-r--r-- | 011load.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/011load.cc b/011load.cc index d06476b0..44d906a3 100644 --- a/011load.cc +++ b/011load.cc @@ -47,9 +47,10 @@ long long int slurp_recipe(istream& in) { if (Recipe_ordinal.find(recipe_name) == Recipe_ordinal.end()) { Recipe_ordinal[recipe_name] = Next_recipe_ordinal++; } - if (warn_on_redefine(recipe_name) - && Recipe.find(Recipe_ordinal[recipe_name]) != Recipe.end()) { - raise << "redefining recipe " << Recipe[Recipe_ordinal[recipe_name]].name << "\n" << end(); + if (Recipe.find(Recipe_ordinal[recipe_name]) != Recipe.end()) { + if (warn_on_redefine(recipe_name)) + raise << "redefining recipe " << Recipe[Recipe_ordinal[recipe_name]].name << "\n" << end(); + Recipe.erase(Recipe_ordinal[recipe_name]); } // todo: save user-defined recipes to mu's memory Recipe[Recipe_ordinal[recipe_name]] = slurp_body(in); |