about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-30 12:34:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-30 12:34:40 -0700
commit1d0a623ac62cb7ba317cc7cd1afe0b10d67b5172 (patch)
tree006015ab8b0d55727c549069f5d847e547000453
parent3d68a0b026e6551e962124f3a1831120dbd553b7 (diff)
downloadmu-1d0a623ac62cb7ba317cc7cd1afe0b10d67b5172.tar.gz
1515 - complain on unbalanced brackets
-rw-r--r--013literal_string.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/013literal_string.cc b/013literal_string.cc
index 02e8ea93..b31bc702 100644
--- a/013literal_string.cc
+++ b/013literal_string.cc
@@ -48,6 +48,10 @@ string slurp_quoted(istream& in) {
     if (c == ']') --brace_depth;
     if (brace_depth == 0) break;
   }
+  if (in.eof() && brace_depth > 0) {
+    raise << "unbalanced '['\n";
+    return "";
+  }
   return out.str();
 }