about summary refs log tree commit diff stats
path: root/cpp/031scenario
diff options
context:
space:
mode:
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) {