about summary refs log tree commit diff stats
path: root/011load.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-26 20:54:45 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-26 20:54:45 -0700
commit7b8319f4b8b7b0c80d1e194fa586bfe1f8042fef (patch)
tree91ece89369deb093efb2c51b0b8805201a9b0227 /011load.cc
parent72d5d0185c63860ddebf66432d35a217e35587a1 (diff)
downloadmu-7b8319f4b8b7b0c80d1e194fa586bfe1f8042fef.tar.gz
2285
Still trying to come up with clean lexing rules.
Diffstat (limited to '011load.cc')
-rw-r--r--011load.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/011load.cc b/011load.cc
index 620d6f40..6fee184e 100644
--- a/011load.cc
+++ b/011load.cc
@@ -171,14 +171,15 @@ string next_word(istream& in) {
 }
 
 void slurp_word(istream& in, ostream& out) {
+  static string terminators(",()[]{}");
   char c;
-  if (!in.eof() && in.peek() == ',') {
+  if (!in.eof() && terminators.find(in.peek()) != string::npos) {
     in >> c;
     out << c;
     return;
   }
   while (in >> c) {
-    if (isspace(c) || c == ',') {
+    if (isspace(c) || terminators.find(c) != string::npos) {
       in.putback(c);
       break;
     }