diff options
-rw-r--r-- | 034call.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/034call.cc b/034call.cc index 498dc1a5..08eea8c5 100644 --- a/034call.cc +++ b/034call.cc @@ -81,8 +81,10 @@ inline const instruction& current_instruction() { default: { // not a primitive; try to look up the book of recipes if (Recipe.find(current_instruction().operation) == Recipe.end()) { - raise << "undefined operation " << current_instruction().operation << ": " << current_instruction().to_string() << '\n' << end(); - break; + raise << current_recipe_name() << ": undefined operation in '" << current_instruction().to_string() << "'\n" << end(); + // stop running this instruction immediately + ++current_step_index(); + continue; } Current_routine->calls.push_front(call(current_instruction().operation)); call_housekeeping: @@ -91,6 +93,20 @@ default: { continue; // not done with caller; don't increment current_step_index() } +:(scenario calling_undefined_recipe_warns) +% Hide_warnings = true; +recipe main [ + foo +] ++warn: main: undefined operation in 'foo ' + +:(scenario calling_undefined_recipe_handles_missing_result) +% Hide_warnings = true; +recipe main [ + x:number <- foo +] ++warn: main: undefined operation in 'x:number <- foo ' + //:: finally, we need to fix the termination conditions for the run loop :(replace{} "inline bool routine::completed() const") |