diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 20:00:38 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 20:02:18 -0700 |
commit | ae256ea13efc77cc767a658c6f61b12cd7461e21 (patch) | |
tree | 18dbcb26423b1d17d0639995c4bd29ec8f3d5c17 /013literal_string.cc | |
parent | 7bba6e7bb7fd7bfdfc71626a34a08cb96a084b74 (diff) | |
download | mu-ae256ea13efc77cc767a658c6f61b12cd7461e21.tar.gz |
2283 - represent each /property as a tree
Diffstat (limited to '013literal_string.cc')
-rw-r--r-- | 013literal_string.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/013literal_string.cc b/013literal_string.cc index 9f5d003e..53654e5b 100644 --- a/013literal_string.cc +++ b/013literal_string.cc @@ -112,8 +112,7 @@ if (s.at(0) == '[') { strip_last(s); name = s; type = new type_tree(0); - properties.push_back(pair<string, vector<string> >(name, vector<string>())); - properties.back().second.push_back("literal-string"); + properties.push_back(pair<string, string_tree*>(name, new string_tree("literal-string"))); return; } @@ -126,7 +125,7 @@ if (s.at(0) == '[') { :(code) bool is_literal_string(const reagent& x) { - return !x.properties.at(0).second.empty() && x.properties.at(0).second.at(0) == "literal-string"; + return x.properties.at(0).second && x.properties.at(0).second->value == "literal-string"; } string emit_literal_string(string name) { @@ -172,7 +171,7 @@ recipe main [ ] +parse: instruction: copy +parse: ingredient: {"abc": "literal-string"} -+parse: product: {"1": <"address" : "array" : "character">} ++parse: product: {"1": <"address" : <"array" : "character">>} # no other ingredients $parse: 3 |