From 4690ce81e079fc58cae8d6d583e5e3eb3ed81a83 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 9 Mar 2016 02:56:27 -0800 Subject: 2743 Looks like "TOhtml | " doesn't work on Mac OS X for some reason.. --- html/024jump.cc.html | 94 ++++++++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 51 deletions(-) (limited to 'html/024jump.cc.html') diff --git a/html/024jump.cc.html b/html/024jump.cc.html index 0989240f..a6ae68a9 100644 --- a/html/024jump.cc.html +++ b/html/024jump.cc.html @@ -3,39 +3,32 @@ Mu - 024jump.cc - - + + - - + - - -
+
 //: Jump primitives
 
 :(scenario jump_can_skip_instructions)
-recipe main [
+def main [
   jump 1:offset
   1:number <- copy 1
 ]
@@ -48,19 +41,19 @@ JUMP,
 :(before "End Primitive Recipe Numbers")
 put(Recipe_ordinal, "jump", JUMP);
 :(before "End Primitive Recipe Checks")
-case JUMP: {
-  if (SIZE(inst.ingredients) != 1) {
-    raise_error << maybe(get(Recipe, r).name) << "'jump' requires exactly one ingredient, but got " << to_string(inst) << '\n' << end();
+case JUMP: {
+  if (SIZE(inst.ingredients) != 1) {
+    raise << maybe(get(Recipe, r).name) << "'jump' requires exactly one ingredient, but got " << to_string(inst) << '\n' << end();
     break;
   }
-  if (!is_mu_scalar(inst.ingredients.at(0))) {
-    raise_error << maybe(get(Recipe, r).name) << "first ingredient of 'jump' should be a label or offset, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+  if (!is_mu_scalar(inst.ingredients.at(0))) {
+    raise << maybe(get(Recipe, r).name) << "first ingredient of 'jump' should be a label or offset, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }
   break;
 }
 :(before "End Primitive Recipe Implementations")
-case JUMP: {
+case JUMP: {
   assert(current_instruction().ingredients.at(0).initialized);
   current_step_index() += ingredients.at(0).at(0)+1;
   trace(9998, "run") << "jumping to instruction " << current_step_index() << end();
@@ -72,7 +65,7 @@ case JUMP: {
 put(Type_ordinal, "offset", 0);
 
 :(scenario jump_backward)
-recipe main [
+def main [
   jump 1:offset  # 0 -+
   jump 3:offset  #    |   +-+ 1
                  #   \/  /\ |
@@ -87,25 +80,25 @@ JUMP_IF,
 :(before "End Primitive Recipe Numbers")
 put(Recipe_ordinal, "jump-if", JUMP_IF);
 :(before "End Primitive Recipe Checks")
-case JUMP_IF: {
-  if (SIZE(inst.ingredients) != 2) {
-    raise_error << maybe(get(Recipe, r).name) << "'jump-if' requires exactly two ingredients, but got " << to_string(inst) << '\n' << end();
+case JUMP_IF: {
+  if (SIZE(inst.ingredients) != 2) {
+    raise << maybe(get(Recipe, r).name) << "'jump-if' requires exactly two ingredients, but got " << to_string(inst) << '\n' << end();
     break;
   }
-  if (!is_mu_scalar(inst.ingredients.at(0))) {
-    raise_error << maybe(get(Recipe, r).name) << "'jump-if' requires a boolean for its first ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+  if (!is_mu_scalar(inst.ingredients.at(0))) {
+    raise << maybe(get(Recipe, r).name) << "'jump-if' requires a boolean for its first ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }
-  if (!is_mu_scalar(inst.ingredients.at(1))) {
-    raise_error << maybe(get(Recipe, r).name) << "'jump-if' requires a label or offset for its second ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+  if (!is_mu_scalar(inst.ingredients.at(1))) {
+    raise << maybe(get(Recipe, r).name) << "'jump-if' requires a label or offset for its second ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }
   break;
 }
 :(before "End Primitive Recipe Implementations")
-case JUMP_IF: {
+case JUMP_IF: {
   assert(current_instruction().ingredients.at(1).initialized);
-  if (!ingredients.at(0).at(0)) {
+  if (!ingredients.at(0).at(0)) {
     trace(9998, "run") << "jump-if fell through" << end();
     break;
   }
@@ -115,8 +108,8 @@ case JUMP_IF: {
 }
 
 :(scenario jump_if)
-recipe main [
-  jump-if 999, 1:offset
+def main [
+  jump-if 999, 1:offset
   123:number <- copy 1
 ]
 +run: jump-if 999, 1:offset
@@ -125,8 +118,8 @@ recipe main [
 -mem: storing 1 in location 123
 
 :(scenario jump_if_fallthrough)
-recipe main [
-  jump-if 0, 1:offset
+def main [
+  jump-if 0, 1:offset
   123:number <- copy 1
 ]
 +run: jump-if 0, 1:offset
@@ -139,25 +132,25 @@ JUMP_UNLESS,
 :(before "End Primitive Recipe Numbers")
 put(Recipe_ordinal, "jump-unless", JUMP_UNLESS);
 :(before "End Primitive Recipe Checks")
-case JUMP_UNLESS: {
-  if (SIZE(inst.ingredients) != 2) {
-    raise_error << maybe(get(Recipe, r).name) << "'jump-unless' requires exactly two ingredients, but got " << to_string(inst) << '\n' << end();
+case JUMP_UNLESS: {
+  if (SIZE(inst.ingredients) != 2) {
+    raise << maybe(get(Recipe, r).name) << "'jump-unless' requires exactly two ingredients, but got " << to_string(inst) << '\n' << end();
     break;
   }
-  if (!is_mu_scalar(inst.ingredients.at(0))) {
-    raise_error << maybe(get(Recipe, r).name) << "'jump-unless' requires a boolean for its first ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+  if (!is_mu_scalar(inst.ingredients.at(0))) {
+    raise << maybe(get(Recipe, r).name) << "'jump-unless' requires a boolean for its first ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }
-  if (!is_mu_scalar(inst.ingredients.at(1))) {
-    raise_error << maybe(get(Recipe, r).name) << "'jump-unless' requires a label or offset for its second ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+  if (!is_mu_scalar(inst.ingredients.at(1))) {
+    raise << maybe(get(Recipe, r).name) << "'jump-unless' requires a label or offset for its second ingredient, but got " << inst.ingredients.at(0).original_string << '\n' << end();
     break;
   }
   break;
 }
 :(before "End Primitive Recipe Implementations")
-case JUMP_UNLESS: {
+case JUMP_UNLESS: {
   assert(current_instruction().ingredients.at(1).initialized);
-  if (ingredients.at(0).at(0)) {
+  if (ingredients.at(0).at(0)) {
     trace(9998, "run") << "jump-unless fell through" << end();
     break;
   }
@@ -167,7 +160,7 @@ case JUMP_UNLESS: {
 }
 
 :(scenario jump_unless)
-recipe main [
+def main [
   jump-unless 0, 1:offset
   123:number <- copy 1
 ]
@@ -177,7 +170,7 @@ recipe main [
 -mem: storing 1 in location 123
 
 :(scenario jump_unless_fallthrough)
-recipe main [
+def main [
   jump-unless 999, 1:offset
   123:number <- copy 1
 ]
@@ -188,4 +181,3 @@ recipe main [
 
- -- cgit 1.4.1-2-gfad0