about summary refs log tree commit diff stats
path: root/cpp/024brace
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/024brace')
-rw-r--r--cpp/024brace18
1 files changed, 6 insertions, 12 deletions
diff --git a/cpp/024brace b/cpp/024brace
index aa8c7a4c..f61fb6ac 100644
--- a/cpp/024brace
+++ b/cpp/024brace
@@ -66,8 +66,7 @@ void transform_braces(const recipe_number r) {
       }
       else {
         reagent ing(0);  // literal
-        ing.value = open_braces.top()-index;
-        ing.initialized = true;
+        ing.set_value(open_braces.top()-index);
         inst.ingredients.push_back(ing);
         trace("after-brace") << "jump " << ing.value << ":offset";
         trace("after-brace") << index << ": " << ing.to_string();
@@ -82,8 +81,7 @@ void transform_braces(const recipe_number r) {
       }
       else {
         reagent ing(0);  // literal
-        ing.value = matching_brace(open_braces.top(), braces) - index - 1;
-        ing.initialized = true;
+        ing.set_value(matching_brace(open_braces.top(), braces) - index - 1);
         inst.ingredients.push_back(ing);
         trace("after-brace") << "jump " << ing.value << ":offset";
       }
@@ -96,8 +94,7 @@ void transform_braces(const recipe_number r) {
       }
       else {
         reagent ing(0);  // literal
-        ing.value = open_braces.top()-index;
-        ing.initialized = true;
+        ing.set_value(open_braces.top()-index);
         inst.ingredients.push_back(ing);
         trace("after-brace") << "jump-if " << inst.ingredients[0].name << ", " << ing.value << ":offset";
       }
@@ -110,8 +107,7 @@ void transform_braces(const recipe_number r) {
       }
       else {
         reagent ing(0);  // literal
-        ing.value = matching_brace(open_braces.top(), braces) - index - 1;
-        ing.initialized = true;
+        ing.set_value(matching_brace(open_braces.top(), braces) - index - 1);
         inst.ingredients.push_back(ing);
         trace("after-brace") << "jump-if " << inst.ingredients[0].name << ", " << ing.value << ":offset";
       }
@@ -124,8 +120,7 @@ void transform_braces(const recipe_number r) {
       }
       else {
         reagent ing(0);  // literal
-        ing.value = open_braces.top()-index;
-        ing.initialized = true;
+        ing.set_value(open_braces.top()-index);
         inst.ingredients.push_back(ing);
         trace("after-brace") << "jump-unless " << inst.ingredients[0].name << ", " << ing.value << ":offset";
       }
@@ -138,8 +133,7 @@ void transform_braces(const recipe_number r) {
       }
       else {
         reagent ing(0);  // literal
-        ing.value = matching_brace(open_braces.top(), braces) - index - 1;
-        ing.initialized = true;
+        ing.set_value(matching_brace(open_braces.top(), braces) - index - 1);
         inst.ingredients.push_back(ing);
         trace("after-brace") << "jump-unless " << inst.ingredients[0].name << ", " << ing.value << ":offset";
       }