about summary refs log tree commit diff stats
path: root/cpp/031scenario
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-12 22:42:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-12 22:42:07 -0700
commit0edc9471c773ab0ce0ae0abcffacf41e1440742d (patch)
treeb5f7242ed993b796a50c4bdb79ff1ae3d734bcc9 /cpp/031scenario
parent5a9520332a70f8d2e86bc3564bcd4bffde182e87 (diff)
downloadmu-0edc9471c773ab0ce0ae0abcffacf41e1440742d.tar.gz
1055
Diffstat (limited to 'cpp/031scenario')
-rw-r--r--cpp/031scenario13
1 files changed, 5 insertions, 8 deletions
diff --git a/cpp/031scenario b/cpp/031scenario
index 8a3ced47..f3bd582c 100644
--- a/cpp/031scenario
+++ b/cpp/031scenario
@@ -62,7 +62,7 @@ scenario parse_scenario(istream& in) {
     }
     // End Scenario Command Handlers
     else {
-      raise << "unknown command in scenario: ^" << scenario_command << "$";
+      raise << "unknown command in scenario: ^" << scenario_command << "$\n";
     }
   }
   return x;
@@ -77,15 +77,12 @@ void handle_scenario_run_directive(istream& in, scenario& result) {
 
 void handle_scenario_memory_directive(istream& in, scenario& out) {
   if (next_word(in) != "should") {
-    raise << "'memory' directive inside scenario must continue 'memory should'";
+    raise << "'memory' directive inside scenario must continue 'memory should'\n";
   }
   if (next_word(in) != "contain") {
-    raise << "'memory' directive inside scenario must continue 'memory should contain'";
-  }
-  skip_whitespace_and_comments(in);
-  if (in.get() != '[') {
-    raise << "'memory' directive inside scenario must begin with 'memory should contain ['";
+    raise << "'memory' directive inside scenario must continue 'memory should contain'\n";
   }
+  skip_bracket(in, "'memory' directive inside scenario must begin with 'memory should contain ['\n");
   while (true) {
     skip_whitespace_and_comments(in);
     if (in.eof()) break;
@@ -120,7 +117,7 @@ void slurp_until_matching_bracket(istream& in, ostream& out) {
 void skip_bracket(istream& in, string message) {
   skip_whitespace(in);  skip_comments_and_newlines(in);  skip_whitespace(in);
   if (in.get() != '[')
-    raise << message;
+    raise << message << '\n';
 }
 
 void skip_whitespace_and_comments(istream& in) {