diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-04 09:32:26 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-04 09:32:26 -0700 |
commit | c594062cba29a09abf9574f72f3d2a6e9a2aa224 (patch) | |
tree | 4354f98e02e416b761d46d520a8cbb903db7e4c9 | |
parent | 38e96056e47a68e45c229a5e2f788a72a8efe206 (diff) | |
download | mu-c594062cba29a09abf9574f72f3d2a6e9a2aa224.tar.gz |
3438
-rw-r--r-- | 089scenario_filesystem.cc | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/089scenario_filesystem.cc b/089scenario_filesystem.cc index 1abdf5ea..1c09d0bd 100644 --- a/089scenario_filesystem.cc +++ b/089scenario_filesystem.cc @@ -114,7 +114,7 @@ void parse_filesystem(const string& data, map<string, string>& out, const string if (!has_data(in)) break; skip_whitespace_and_comments(in); if (!has_data(in)) break; - string filename = next_filesystem_word(in); + string filename = next_word(in); if (*filename.begin() != '[') { raise << caller << ": assume-filesystem: filename '" << filename << "' must begin with a '['\n" << end(); break; @@ -129,7 +129,7 @@ void parse_filesystem(const string& data, map<string, string>& out, const string raise << caller << ": assume-filesystem: no data for filename '" << filename << "'\n" << end(); break; } - string arrow = next_filesystem_word(in); + string arrow = next_word(in); if (arrow != "<-") { raise << caller << ": assume-filesystem: expected '<-' after filename '" << filename << "' but got '" << arrow << "'\n" << end(); break; @@ -138,7 +138,7 @@ void parse_filesystem(const string& data, map<string, string>& out, const string raise << caller << ": assume-filesystem: no data for filename '" << filename << "' after '<-'\n" << end(); break; } - string contents = next_filesystem_word(in); + string contents = next_word(in); if (*contents.begin() != '[') { raise << caller << ": assume-filesystem: file contents '" << contents << "' for filename '" << filename << "' must begin with a '['\n" << end(); break; @@ -230,19 +230,6 @@ int size_of_filesystem() { return result; } -string next_filesystem_word(istream& in) { - skip_whitespace_and_comments(in); - if (in.peek() == '[') { - string result = slurp_quoted(in); - skip_whitespace_and_comments_but_not_newline(in); - return result; - } - ostringstream out; - slurp_word(in, out); - skip_whitespace_and_comments(in); - return out.str(); -} - void skip_whitespace(istream& in) { while (true) { if (!has_data(in)) break; |