diff options
-rw-r--r-- | 029tools.cc | 6 | ||||
-rw-r--r-- | 060rewrite_literal_string.cc | 1 | ||||
-rw-r--r-- | html/029tools.cc.html | 6 | ||||
-rw-r--r-- | html/060rewrite_literal_string.cc.html | 1 |
4 files changed, 6 insertions, 8 deletions
diff --git a/029tools.cc b/029tools.cc index 79f6ba84..67c58154 100644 --- a/029tools.cc +++ b/029tools.cc @@ -210,8 +210,8 @@ case ASSERT: { raise << maybe(get(Recipe, r).name) << "'assert' requires a boolean for its first ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); break; } - if (!is_literal_text(inst.ingredients.at(1))) { - raise << maybe(get(Recipe, r).name) << "'assert' requires a literal string for its second ingredient, but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); + if (!is_mu_text(inst.ingredients.at(1))) { + raise << maybe(get(Recipe, r).name) << "'assert' requires a text as its second ingredient, but got '" << inst.ingredients.at(1).original_string << "'\n" << end(); break; } break; @@ -219,7 +219,7 @@ case ASSERT: { :(before "End Primitive Recipe Implementations") case ASSERT: { if (!ingredients.at(0).at(0)) { - raise << current_instruction().ingredients.at(1).name << '\n' << end(); + raise << read_mu_text(ingredients.at(1).at(0)) << '\n' << end(); } break; } diff --git a/060rewrite_literal_string.cc b/060rewrite_literal_string.cc index f6f9888d..3310bf9d 100644 --- a/060rewrite_literal_string.cc +++ b/060rewrite_literal_string.cc @@ -24,7 +24,6 @@ void initialize_transform_rewrite_literal_string_to_text() { recipes_taking_literal_strings.insert("$system"); recipes_taking_literal_strings.insert("trace"); recipes_taking_literal_strings.insert("stash"); - recipes_taking_literal_strings.insert("assert"); recipes_taking_literal_strings.insert("new"); recipes_taking_literal_strings.insert("run"); recipes_taking_literal_strings.insert("memory-should-contain"); diff --git a/html/029tools.cc.html b/html/029tools.cc.html index da2f41ab..89cd93ad 100644 --- a/html/029tools.cc.html +++ b/html/029tools.cc.html @@ -247,8 +247,8 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span raise << maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'assert' requires a boolean for its first ingredient, but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>!is_literal_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> - raise << maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'assert' requires a literal string for its second ingredient, but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> + raise << maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'assert' requires a text as its second ingredient, but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -256,7 +256,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> <span class="Normal">case</span> ASSERT: <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> - raise << current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> + raise << read_mu_text<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> <span class="Delimiter">}</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> diff --git a/html/060rewrite_literal_string.cc.html b/html/060rewrite_literal_string.cc.html index a2e46f7c..2ad95bb8 100644 --- a/html/060rewrite_literal_string.cc.html +++ b/html/060rewrite_literal_string.cc.html @@ -58,7 +58,6 @@ set<string> recipes_taking_literal_strings<span class="Delimiter">;</span> recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"$system"</span><span class="Delimiter">);</span> recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"trace"</span><span class="Delimiter">);</span> recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"stash"</span><span class="Delimiter">);</span> - recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"assert"</span><span class="Delimiter">);</span> recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"new"</span><span class="Delimiter">);</span> recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"run"</span><span class="Delimiter">);</span> recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"memory-should-contain"</span><span class="Delimiter">);</span> |