about summary refs log tree commit diff stats
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
parent5a9520332a70f8d2e86bc3564bcd4bffde182e87 (diff)
downloadmu-0edc9471c773ab0ce0ae0abcffacf41e1440742d.tar.gz
1055
-rw-r--r--cpp/011load2
-rw-r--r--cpp/013run2
-rw-r--r--cpp/025name2
-rw-r--r--cpp/031scenario13
4 files changed, 8 insertions, 11 deletions
diff --git a/cpp/011load b/cpp/011load
index 3939f72f..9978ac8c 100644
--- a/cpp/011load
+++ b/cpp/011load
@@ -27,7 +27,7 @@ vector<recipe_number> add_recipes(istream& in) {
     }
     // End Command Handlers
     else {
-      raise << "unknown top-level command: " << command;
+      raise << "unknown top-level command: " << command << '\n';
     }
   }
   return result;
diff --git a/cpp/013run b/cpp/013run
index 0a1f6529..5ba9af70 100644
--- a/cpp/013run
+++ b/cpp/013run
@@ -144,7 +144,7 @@ void write_memory(reagent x, vector<int> data) {
   if (is_dummy(x)) return;
   int base = x.value;
   if (size_of(x) != data.size())
-    raise << "size mismatch in storing to " << x.to_string();
+    raise << "size mismatch in storing to " << x.to_string() << '\n';
   for (size_t offset = 0; offset < data.size(); ++offset) {
     trace("mem") << "storing " << data[offset] << " in location " << base+offset;
     Memory[base+offset] = data[offset];
diff --git a/cpp/025name b/cpp/025name
index 03fec138..46e559a5 100644
--- a/cpp/025name
+++ b/cpp/025name
@@ -48,7 +48,7 @@ void transform_names(const recipe_number r) {
           && inst.ingredients[in].types[0]
           && inst.ingredients[in].name.find_first_not_of("0123456789-.") != string::npos) {
         if (names.find(inst.ingredients[in].name) == names.end()) {
-          raise << "use before set: " << inst.ingredients[in].name << " in " << Recipe[r].name;
+          raise << "use before set: " << inst.ingredients[in].name << " in " << Recipe[r].name << '\n';
         }
         inst.ingredients[in].set_value(names[inst.ingredients[in].name]);
       }
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) {