From 66b97b4d923274e1b6d2fd97df16cb73d820169b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 30 Mar 2015 21:22:29 -0700 Subject: 996 - string literals --- cpp/010vm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cpp/010vm') 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 :::...///... 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 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() { -- cgit 1.4.1-2-gfad0