From 1848b18f02b158861008214efd19708585bfcbe5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 17 Apr 2015 10:31:17 -0700 Subject: 1073 - stop fixing the values of primitive recipes In the process I give up trace stability when I move files around, but I gain in exchange the ability to move files around. --- cpp/030brace | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'cpp/030brace') diff --git a/cpp/030brace b/cpp/030brace index 0d68b54f..d01fe359 100644 --- a/cpp/030brace +++ b/cpp/030brace @@ -1,6 +1,6 @@ //: Structured programming //: -//: Our jump operators are quite inconvenient to use, so mu provides a +//: Our jump recipes are quite inconvenient to use, so mu provides a //: lightweight tool called 'transform_braces' to work in a slightly more //: convenient format with nested braces: //: @@ -168,34 +168,23 @@ void transform_test(string form) { //? cout << "AAA }\n"; //? 1 } -//: Make sure these pseudo recipes get consistent numbers, even though they aren't -//: implemented. -:(before "End Globals") -const int BREAK = 24; -const int BREAK_IF = 25; -const int BREAK_UNLESS = 26; -const int LOOP = 27; -const int LOOP_IF = 28; -const int LOOP_UNLESS = 29; +//: Make sure these pseudo recipes get consistent numbers in all tests, even +//: though they aren't implemented. + +:(before "End Primitive Recipe Declarations") +BREAK, +BREAK_IF, +BREAK_UNLESS, +LOOP, +LOOP_IF, +LOOP_UNLESS, :(before "End Primitive Recipe Numbers") Recipe_number["break"] = BREAK; -assert(Next_recipe_number == BREAK); -Next_recipe_number++; Recipe_number["break-if"] = BREAK_IF; -assert(Next_recipe_number == BREAK_IF); -Next_recipe_number++; Recipe_number["break-unless"] = BREAK_UNLESS; -assert(Next_recipe_number == BREAK_UNLESS); -Next_recipe_number++; Recipe_number["loop"] = LOOP; -assert(Next_recipe_number == LOOP); -Next_recipe_number++; Recipe_number["loop-if"] = LOOP_IF; -assert(Next_recipe_number == LOOP_IF); -Next_recipe_number++; Recipe_number["loop-unless"] = LOOP_UNLESS; -assert(Next_recipe_number == LOOP_UNLESS); -Next_recipe_number++; :(scenario "loop") recipe main [ -- cgit 1.4.1-2-gfad0