From b142a7620246d57b461e5863b9d1092a917a2fc3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 16 May 2015 13:17:36 -0700 Subject: 1383 - warn on unknown type This bit me in the last commit for the first time. Layer 010vm.cc is starting to look weird. It has references to stuff that gets implemented much later, like containers and exclusive containers. Its helpers are getting an increasing amount of logic. And it has no tests. I'm still inclined to think it's useful to have major data structures in one place, even if they aren't used for a bit. But those helpers should perhaps move out somehow or get some tests in the same layer. --- 010vm.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '010vm.cc') diff --git a/010vm.cc b/010vm.cc index 9b1641bd..c5e13543 100644 --- a/010vm.cc +++ b/010vm.cc @@ -183,7 +183,10 @@ reagent::reagent(string s) :value(0), initialized(false) { // structures for the first row of properties name = properties.at(0).first; for (index_t i = 0; i < properties.at(0).second.size(); ++i) { - types.push_back(Type_number[properties.at(0).second.at(i)]); + string type = properties.at(0).second.at(i); + if (Type_number.find(type) == Type_number.end()) + raise << "unknown type: " << type << '\n'; + types.push_back(Type_number[type]); } if (name == "_" && types.empty()) { types.push_back(0); -- cgit 1.4.1-2-gfad0