about summary refs log tree commit diff stats
path: root/cpp/010vm
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/010vm')
-rw-r--r--cpp/010vm10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpp/010vm b/cpp/010vm
index 76ccc4bf..966b095e 100644
--- a/cpp/010vm
+++ b/cpp/010vm
@@ -148,9 +148,11 @@ void setup_recipes() {
   // Reagents have the form <name>:<type>:<type>:.../<property>/<property>/...
   reagent::reagent(string s) :value(0), initialized(false) {
     istringstream in(s);
+    in >> std::noskipws;
     // properties
     while (!in.eof()) {
       istringstream row(slurp_until(in, '/'));
+      row >> std::noskipws;
       string name = slurp_until(row, ':');
       vector<string> values;
       while (!row.eof())
@@ -162,6 +164,14 @@ void setup_recipes() {
     for (size_t i = 0; i < properties[0].second.size(); ++i) {
       types.push_back(Type_number[properties[0].second[i]]);
     }
+    if (name == "_" && types.empty()) {
+      types.push_back(0);
+      properties[0].second.push_back("dummy");
+    }
+    else if (types.empty()) {  // hacky test for string
+      types.push_back(0);
+      properties[0].second.push_back("literal-string");
+    }
   }
   reagent::reagent() :value(0), initialized(false) {}
   string reagent::to_string() {