diff options
-rw-r--r-- | 037call_reply.cc | 5 | ||||
-rw-r--r-- | edit.mu | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/037call_reply.cc b/037call_reply.cc index 951e6a6b..0d277658 100644 --- a/037call_reply.cc +++ b/037call_reply.cc @@ -19,6 +19,7 @@ Recipe_number["reply"] = REPLY; :(before "End Primitive Recipe Implementations") case REPLY: { const instruction& reply_inst = current_instruction(); // save pointer into recipe before pop + const string& callee = current_recipe_name(); --Callstack_depth; //? if (tb_is_active()) { //? 1 //? tb_clear(); //? 1 @@ -40,7 +41,7 @@ case REPLY: { assert(SIZE(tmp) == 1); long long int ingredient_index = to_integer(tmp.at(0)); if (caller_instruction.products.at(i).value != caller_instruction.ingredients.at(ingredient_index).value) - raise << "'same-as-ingredient' result " << caller_instruction.products.at(i).value << " must be location " << caller_instruction.ingredients.at(ingredient_index).value << '\n'; + raise << current_recipe_name() << ": 'same-as-ingredient' result " << caller_instruction.products.at(i).value << " from call to " << callee << " must be location " << caller_instruction.ingredients.at(ingredient_index).value << '\n'; } } break; // continue to process rest of *caller* instruction @@ -75,7 +76,7 @@ recipe test1 [ 10:address:number <- next-ingredient reply 10:address:number/same-as-ingredient:0 ] -+warn: 'same-as-ingredient' result 2 must be location 1 ++warn: main: 'same-as-ingredient' result 2 from call to test1 must be location 1 :(code) string to_string(const vector<double>& in) { diff --git a/edit.mu b/edit.mu index 18283b9a..85250b27 100644 --- a/edit.mu +++ b/edit.mu @@ -1,4 +1,4 @@ -# Editor widget: takes a string and screen coordinates, and returns a new string. +# Editor widget: takes a string and screen coordinates, modifying them in place. recipe main [ default-space:address:array:location <- new location:type, 30:literal @@ -22,7 +22,7 @@ scenario edit-prints-string-to-screen [ assume-keyboard [] run [ s:address:array:character <- new [abc] - s2:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 0:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address + s:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 0:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address ] screen-should-contain [ .abc . @@ -42,7 +42,8 @@ recipe edit [ right:number <- next-ingredient right:number <- subtract right:number, 1:literal keyboard:address <- next-ingredient - render s:address:array:character, screen:address, top:number, left:number, bottom:number, right:number + screen:address <- render s:address:array:character, screen:address, top:number, left:number, bottom:number, right:number + reply s:address:array:character/same-as-ingredient:0, screen:address/same-as-ingredient:1, keyboard:address/same-as-ingredient:6 ] recipe render [ @@ -100,6 +101,7 @@ recipe render [ column:number <- add column:number, 1:literal loop } + reply screen:address/same-as-ingredient:1 ] scenario edit-prints-multiple-lines [ @@ -108,7 +110,7 @@ scenario edit-prints-multiple-lines [ run [ s:address:array:character <- new [abc def] - s2:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 0:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address + s:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 0:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address ] screen-should-contain [ .abc . @@ -122,7 +124,7 @@ scenario edit-handles-offsets [ assume-keyboard [] run [ s:address:array:character <- new [abc] - s2:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 1:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address + s:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 1:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address ] screen-should-contain [ . abc . @@ -137,7 +139,7 @@ scenario edit-prints-multiple-lines-at-offset [ run [ s:address:array:character <- new [abc def] - s2:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 1:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address + s:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 1:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address ] screen-should-contain [ . abc . @@ -151,7 +153,7 @@ scenario edit-wraps-long-lines [ assume-keyboard [] run [ s:address:array:character <- new [abc def] - s2:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 0:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address + s:address:array:character, screen:address, keyboard:address <- edit s:address:array:character, screen:address, 0:literal/top, 0:literal/left, 10:literal/bottom, 5:literal/right, keyboard:address ] screen-should-contain [ .abc ↩. |