From 06c2b19c9cd33f3dd8aa28e2fb51dee3e26fd6f4 Mon Sep 17 00:00:00 2001 From: olpc user Date: Sun, 5 Jan 2020 13:49:46 -0800 Subject: progress on runtime errors --- starts/meaning-vm/level2.cpp | 5 +++-- 1 file 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(); 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); -- cgit v1.2.3