From 9542bb112419d575190a72baf7f964c3e32df223 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 25 Jul 2015 22:15:51 -0700 Subject: 1853 --- html/037recipe.cc.html | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'html/037recipe.cc.html') diff --git a/html/037recipe.cc.html b/html/037recipe.cc.html index a84b95ef..ce2f2798 100644 --- a/html/037recipe.cc.html +++ b/html/037recipe.cc.html @@ -13,13 +13,15 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } -.traceContains { color: #008000; } +.cSpecial { color: #008000; } .Constant { color: #00a0a0; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.CommentedCode { color: #6c6c6c; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } .Special { color: #ff6060; } -.CommentedCode { color: #6c6c6c; } .Identifier { color: #804000; } +.traceContains { color: #008000; } --> @@ -65,7 +67,7 @@ type_ordinal recipe_ordinal = Type_ordinal["recipe-o Type[recipe_ordinal].name = "recipe-ordinal"; :(before "End Reagent-parsing Exceptions") -if (r.properties.at(0).second.at(0) == "recipe") { +if (!r.properties.at(0).second.empty() && r.properties.at(0).second.at(0) == "recipe") { r.set_value(Recipe_ordinal[r.name]); return; } @@ -75,14 +77,22 @@ CALL, :(before "End Primitive Recipe Numbers") Recipe_ordinal["call"] = CALL; :(before "End Primitive Recipe Implementations") -case CALL: { - assert(scalar(ingredients.at(0))); +case CALL: { + if (ingredients.empty()) { + raise << current_recipe_name() << ": 'call' requires at least one ingredient (the recipe to call)\n" << end(); + break; + } + // Begin Call + if (!scalar(ingredients.at(0))) { + raise << current_recipe_name() << ": first ingredient of 'call' should be a recipe, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end(); + break; + } // todo: when we start doing type checking this will be a prime point of // attention, so we don't accidentally allow external data to a program to // run as code. Current_routine->calls.push_front(call(ingredients.at(0).at(0))); ingredients.erase(ingredients.begin()); // drop the callee - goto complete_call; + goto call_housekeeping; } -- cgit 1.4.1-2-gfad0