about summary refs log tree commit diff stats
path: root/056recipe_header.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-17 23:15:03 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-17 23:15:03 -0800
commit83d8299d2d966c39b4970828ff5743a5b05e3287 (patch)
treed2b0203d068b1c5651c58928c0f2fdf98d558789 /056recipe_header.cc
parent94fed2020040cf469bd47c8890ed4e609e3ed561 (diff)
downloadmu-83d8299d2d966c39b4970828ff5743a5b05e3287.tar.gz
2562
We want to use the type 'recipe' for recipe *variables*, because it
seems nicer to say `recipe number -> number` rather than recipe-ordinal,
etc. To support this we'll allow recipe names to be mentioned without
any type.

This might make a couple of places in this commit more brittle. I'm
dropping error messages, causing them to not happen in some situations.
Maybe I should just bite the bullet and require an explicit
:recipe-literal. We'll see.
Diffstat (limited to '056recipe_header.cc')
-rw-r--r--056recipe_header.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc
index 6797cab8..15c407a5 100644
--- a/056recipe_header.cc
+++ b/056recipe_header.cc
@@ -332,10 +332,8 @@ void deduce_types_from_header(const recipe_ordinal r) {
     trace(9992, "transform") << "instruction: " << inst.to_string() << end();
     for (long long int i = 0; i < SIZE(inst.ingredients); ++i) {
       if (inst.ingredients.at(i).type) continue;
-      if (header_type.find(inst.ingredients.at(i).name) == header_type.end()) {
-        raise << maybe(caller_recipe.name) << "unknown variable " << inst.ingredients.at(i).name << " in '" << inst.to_string() << "'\n" << end();
+      if (header_type.find(inst.ingredients.at(i).name) == header_type.end())
         continue;
-      }
       if (!inst.ingredients.at(i).type)
         inst.ingredients.at(i).type = new type_tree(*get(header_type, inst.ingredients.at(i).name));
       if (!inst.ingredients.at(i).properties.at(0).second)
@@ -345,10 +343,8 @@ void deduce_types_from_header(const recipe_ordinal r) {
     for (long long int i = 0; i < SIZE(inst.products); ++i) {
       trace(9993, "transform") << "  product: " << debug_string(inst.products.at(i)) << end();
       if (inst.products.at(i).type) continue;
-      if (header_type.find(inst.products.at(i).name) == header_type.end()) {
-        raise << maybe(caller_recipe.name) << "unknown variable " << inst.products.at(i).name << " in '" << inst.to_string() << "'\n" << end();
+      if (header_type.find(inst.products.at(i).name) == header_type.end())
         continue;
-      }
       if (!inst.products.at(i).type)
         inst.products.at(i).type = new type_tree(*get(header_type, inst.products.at(i).name));
       if (!inst.products.at(i).properties.at(0).second)