diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 20:54:45 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 20:54:45 -0700 |
commit | 7b8319f4b8b7b0c80d1e194fa586bfe1f8042fef (patch) | |
tree | 91ece89369deb093efb2c51b0b8805201a9b0227 | |
parent | 72d5d0185c63860ddebf66432d35a217e35587a1 (diff) | |
download | mu-7b8319f4b8b7b0c80d1e194fa586bfe1f8042fef.tar.gz |
2285
Still trying to come up with clean lexing rules.
-rw-r--r-- | 011load.cc | 5 |
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; } |