From 9dcbec398c5aedf27757365cc1f4c7c36e138539 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 20 May 2016 22:09:06 -0700 Subject: 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.. --- 040brace.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '040brace.cc') 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. -- cgit 1.4.1-2-gfad0 2545467d27ffee769858f530a096'>themes/forest
blob: be3f3a82cce99aedda438746ee0ff753cbaa5bcd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50