diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2020-01-05 13:49:46 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2020-01-05 13:49:46 -0800 |
commit | 06c2b19c9cd33f3dd8aa28e2fb51dee3e26fd6f4 (patch) | |
tree | 7c4fc442e5010d07077c2aff84356880ed40b553 /starts/meaning-vm | |
parent | 2434ac8c0da3151c4c72ce8c86a9fecbdfcb1f8d (diff) | |
download | standingwithresilience-06c2b19c9cd33f3dd8aa28e2fb51dee3e26fd6f4.tar.gz standingwithresilience-06c2b19c9cd33f3dd8aa28e2fb51dee3e26fd6f4.zip |
progress on runtime errors
Diffstat (limited to 'starts/meaning-vm')
-rw-r--r-- | starts/meaning-vm/level2.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/starts/meaning-vm/level2.cpp b/starts/meaning-vm/level2.cpp index c8080e6..19fdf57 100644 --- a/starts/meaning-vm/level2.cpp +++ b/starts/meaning-vm/level2.cpp @@ -401,10 +401,10 @@ ref parsevalue(ref stream) istream & ss = *stream.val<istream*>(); string word; ss >> word; - if (word[0] == '"' || word[0] == '\'' || word[0] == '`') { + if (word.size() > 0 && (word[0] == '"' || word[0] == '\'' || word[0] == '`')) { char delim = word[0]; string accum = word; - if (accum[accum.size()-1] != delim) { + if (accum[accum.size()-1] != delim || accum.size() == 1) { char c; while ((c = ss.get()) != delim) { accum += c; @@ -571,6 +571,7 @@ void parse(ref stream) ref stream2 = alloc(intellect::level0::concepts::allocations(), (istream*)&ss2); for (ref arg : order.getAll("information-order")) { ref argname = parsevalue(stream2); + if (!ss2) { break; } // depending on whether argname is in localcontext, pass to neededmap or knownmap. also parse literal strings. if (values.count(argname.name())) { neededmap.link(arg, argname); |