diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-03 10:27:55 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-03 10:27:55 -0700 |
commit | 3ae7e543047fe4351a5421519de277052a2bc240 (patch) | |
tree | 09bb752dd124cdbb462b842b9d9666c5c45a5102 | |
parent | 11bf6dedec922728e4e1bc88e697176b03b2b0da (diff) | |
download | mu-3ae7e543047fe4351a5421519de277052a2bc240.tar.gz |
1006
-rw-r--r-- | cpp/025name | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/025name b/cpp/025name index 0d13bf40..6d3b6d2c 100644 --- a/cpp/025name +++ b/cpp/025name @@ -33,9 +33,9 @@ void transform_names(const recipe_number r) { for (size_t in = 0; in < inst.ingredients.size(); ++in) { if (is_raw(inst.ingredients[in])) continue; //? cout << "ingredient " << inst.ingredients[in].name << '\n'; //? 1 - if (inst.ingredients[in].name == "default_space") + if (inst.ingredients[in].name == "default-space") inst.ingredients[in].initialized = true; - if (inst.ingredients[in].name != "default_space" + if (inst.ingredients[in].name != "default-space" && inst.ingredients[in].types[0] && inst.ingredients[in].name.find_first_not_of("0123456789-.") != string::npos) { if (names.find(inst.ingredients[in].name) == names.end()) { @@ -49,10 +49,10 @@ void transform_names(const recipe_number r) { if (is_raw(inst.products[out])) continue; //? cout << "product " << out << '/' << inst.products.size() << " " << inst.products[out].name << '\n'; //? 3 //? cout << inst.products[out].types[0] << '\n'; //? 1 - if (inst.products[out].name == "default_space") + 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].name != "default-space" && inst.products[out].types[0] && inst.products[out].name.find_first_not_of("0123456789-.") != string::npos) { if (names.find(inst.products[out].name) == names.end()) { @@ -102,10 +102,10 @@ recipe main [ //: one reserved word that we'll need later :(scenario "convert_names_passes_default_space") recipe main [ - default_space:integer, x:integer <- copy 0:literal + default-space:integer, x:integer <- copy 0:literal ] +name: assign x 1 --name: assign default_space 1 +-name: assign default-space 1 //: an escape hatch to suppress name conversion that we'll use later :(scenario "convert_names_passes_raw") |