From 2cb36cd09ba464fe7e1f20e19e291f442ed9f576 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 31 Jul 2015 18:25:08 -0700 Subject: 1910 - bugfix: unrecognized recipe with result Thanks Britt Crawford. --- 034call.cc | 20 ++++++++++++++++++-- 1 file 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") -- cgit 1.4.1-2-gfad0 4859e33a01ed2bab4'>blame commit diff stats
path: root/subx/017jump_disp8.cc
blob: 22ae6567199986c919dc4566e00c915897c3cb43 (plain) (tree)
1
2
3
4
5
6
7