From c594062cba29a09abf9574f72f3d2a6e9a2aa224 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 4 Oct 2016 09:32:26 -0700 Subject: 3438 --- 089scenario_filesystem.cc | 19 +++---------------- 1 file 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& 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& 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& 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; -- cgit 1.4.1-2-gfad0