about summary refs log tree commit diff stats
path: root/040brace.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-05-20 22:09:06 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-05-20 22:11:34 -0700
commit9dcbec398c5aedf27757365cc1f4c7c36e138539 (patch)
tree24afbc29a00db1db5b65eb3c390e8d13df7be3ba /040brace.cc
parent5203ba0c5e806ac8e118362d5e2db952a5433e34 (diff)
downloadmu-9dcbec398c5aedf27757365cc1f4c7c36e138539.tar.gz
2990
Standardize quotes around reagents in error messages.

I'm still sure there's issues. For example, the messages when
type-checking 'copy'. I'm not putting quotes around them because in
layer 60 I end up creating dilated reagents, and then it's a bit much to
have quotes and (two kinds of) brackets. But I'm sure I'm doing that
somewhere..
Diffstat (limited to '040brace.cc')
-rw-r--r--040brace.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/040brace.cc b/040brace.cc
index 8cd7e622..02e3e210 100644
--- a/040brace.cc
+++ b/040brace.cc
@@ -61,7 +61,7 @@ void transform_braces(const recipe_ordinal r) {
     }
     if (inst.label == "}") {
       if (open_braces.empty()) {
-        raise << "missing '{' in " << get(Recipe, r).name << '\n' << end();
+        raise << "missing '{' in '" << get(Recipe, r).name << "'\n" << end();
         return;
       }
       open_braces.pop();
@@ -80,7 +80,7 @@ void transform_braces(const recipe_ordinal r) {
     // check for errors
     if (inst.old_name.find("-if") != string::npos || inst.old_name.find("-unless") != string::npos) {
       if (inst.ingredients.empty()) {
-        raise << inst.old_name << " expects 1 or 2 ingredients, but got none\n" << end();
+        raise << "'" << inst.old_name << "' expects 1 or 2 ingredients, but got none\n" << end();
         continue;
       }
     }
@@ -117,7 +117,7 @@ void transform_braces(const recipe_ordinal r) {
     target.type = new type_tree("offset", get(Type_ordinal, "offset"));
     target.set_value(0);
     if (open_braces.empty())
-      raise << inst.old_name << " needs a '{' before\n" << end();
+      raise << "'" << inst.old_name << "' needs a '{' before\n" << end();
     else if (inst.old_name.find("loop") != string::npos)
       target.set_value(open_braces.top()-index);
     else  // break instruction
@@ -350,7 +350,7 @@ def test-factorial [
 def main [
   break
 ]
-+error: break needs a '{' before
++error: 'break' needs a '{' before
 
 :(scenario break_conditional_without_ingredient_fails)
 % Hide_errors = true;
@@ -359,7 +359,7 @@ def main [
     break-if
   }
 ]
-+error: break-if expects 1 or 2 ingredients, but got none
++error: 'break-if' expects 1 or 2 ingredients, but got none
 
 //: Using break we can now implement conditional returns.