about summary refs log tree commit diff stats
path: root/cpp/025name
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-14 10:34:00 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-14 10:39:18 -0700
commit6d6b656fa939e6af886f14d37736f3215a8694fc (patch)
tree8032e502fca318c28d59f292df17a56d0b5d7fee /cpp/025name
parent39171d57b4f67c8f6d761585e12a4f1cd69241c4 (diff)
downloadmu-6d6b656fa939e6af886f14d37736f3215a8694fc.tar.gz
1060
Diffstat (limited to 'cpp/025name')
-rw-r--r--cpp/025name9
1 files changed, 4 insertions, 5 deletions
diff --git a/cpp/025name b/cpp/025name
index 46e559a5..81ab0cc9 100644
--- a/cpp/025name
+++ b/cpp/025name
@@ -44,8 +44,8 @@ void transform_names(const recipe_number r) {
 //?       cout << "ingredient " << inst.ingredients[in].name << '\n'; //? 1
       if (inst.ingredients[in].name == "default-space")
         inst.ingredients[in].initialized = true;
-      if (inst.ingredients[in].name != "default-space"
-          && inst.ingredients[in].types[0]
+      if (inst.ingredients[in].types[0]  // not a literal
+          && !inst.ingredients[in].initialized
           && inst.ingredients[in].name.find_first_not_of("0123456789-.") != string::npos) {
         if (names.find(inst.ingredients[in].name) == names.end()) {
           raise << "use before set: " << inst.ingredients[in].name << " in " << Recipe[r].name << '\n';
@@ -59,9 +59,8 @@ void transform_names(const recipe_number r) {
 //?       cout << inst.products[out].types[0] << '\n'; //? 1
       if (inst.products[out].name == "default-space")
         inst.products[out].initialized = true;
-      if (inst.products[out].name != "_"
-          && inst.products[out].name != "default-space"
-          && inst.products[out].types[0]
+      if (inst.products[out].types[0]  // not a literal
+          && !inst.products[out].initialized
           && inst.products[out].name.find_first_not_of("0123456789-.") != string::npos) {
         if (names.find(inst.products[out].name) == names.end()) {
           trace("name") << "assign " << inst.products[out].name << " " << curr_idx;