diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-01-01 17:04:37 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-01-01 17:04:37 -0800 |
commit | 2a4088119cf41175457414dfa59bd4064b8f0562 (patch) | |
tree | 64fe184e399f9870ebd481a90eec34d51e5dff68 /archive/1.vm/998check_type_pointers.cc | |
parent | 23fd294d85959c6b476bcdc35ed6ad508cc99b8f (diff) | |
download | mu-2a4088119cf41175457414dfa59bd4064b8f0562.tar.gz |
5852
Diffstat (limited to 'archive/1.vm/998check_type_pointers.cc')
-rw-r--r-- | archive/1.vm/998check_type_pointers.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/archive/1.vm/998check_type_pointers.cc b/archive/1.vm/998check_type_pointers.cc new file mode 100644 index 00000000..da19cf3e --- /dev/null +++ b/archive/1.vm/998check_type_pointers.cc @@ -0,0 +1,36 @@ +//: enable this when tracking down null types +//: (but it interferes with edit/; since recipes created in the environment +//: can raise warnings here which will stop running the entire environment) +//? :(before "End Transform All") +//? check_type_pointers(); +//? +//? :(code) +//? void check_type_pointers() { +//? for (map<recipe_ordinal, recipe>::iterator p = Recipe.begin(); p != Recipe.end(); ++p) { +//? if (any_type_ingredient_in_header(p->first)) continue; +//? const recipe& r = p->second; +//? for (long long int i = 0; i < SIZE(r.steps); ++i) { +//? const instruction& inst = r.steps.at(i); +//? for (long long int j = 0; j < SIZE(inst.ingredients); ++j) { +//? if (!inst.ingredients.at(j).type) { +//? raise_error << maybe(r.name) << " '" << inst.to_string() << "' -- " << inst.ingredients.at(j).to_string() << " has no type\n" << end(); +//? return; +//? } +//? if (!inst.ingredients.at(j).properties.at(0).second) { +//? raise_error << maybe(r.name) << " '" << inst.to_string() << "' -- " << inst.ingredients.at(j).to_string() << " has no type name\n" << end(); +//? return; +//? } +//? } +//? for (long long int j = 0; j < SIZE(inst.products); ++j) { +//? if (!inst.products.at(j).type) { +//? raise_error << maybe(r.name) << " '" << inst.to_string() << "' -- " << inst.products.at(j).to_string() << " has no type\n" << end(); +//? return; +//? } +//? if (!inst.products.at(j).properties.at(0).second) { +//? raise_error << maybe(r.name) << " '" << inst.to_string() << "' -- " << inst.products.at(j).to_string() << " has no type name\n" << end(); +//? return; +//? } +//? } +//? } +//? } +//? } |