about summary refs log tree commit diff stats
path: root/047global.cc
diff options
context:
space:
mode:
Diffstat (limited to '047global.cc')
-rw-r--r--047global.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/047global.cc b/047global.cc
index 00e8ff15..d0a3d47e 100644
--- a/047global.cc
+++ b/047global.cc
@@ -31,10 +31,15 @@ long long int global_space;
 global_space = 0;
 :(after "void write_memory(reagent x, vector<double> data)")
   if (x.name == "global-space") {
-    if (!scalar(data))
-      raise << maybe(current_recipe_name()) << "'global-space' should be of type address:array:location, but tried to write " << to_string(data) << '\n' << end();
+    if (!scalar(data)
+        || SIZE(x.types) != 3
+        || x.types.at(0) != Type_ordinal["address"]
+        || x.types.at(1) != Type_ordinal["array"]
+        || x.types.at(2) != Type_ordinal["location"]) {
+      raise_error << maybe(current_recipe_name()) << "'global-space' should be of type address:array:location, but tried to write " << to_string(data) << '\n' << end();
+    }
     if (Current_routine->global_space)
-      raise << "routine already has a global-space; you can't over-write your globals" << end();
+      raise_error << "routine already has a global-space; you can't over-write your globals" << end();
     Current_routine->global_space = data.at(0);
     return;
   }
@@ -43,7 +48,7 @@ global_space = 0;
 :(after "long long int space_base(const reagent& x)")
   if (is_global(x)) {
     if (!Current_routine->global_space)
-      raise << "routine has no global space\n" << end();
+      raise_error << "routine has no global space\n" << end();
     return Current_routine->global_space;
   }
 
@@ -51,14 +56,14 @@ global_space = 0;
 //: don't want to make them too comfortable to use.
 
 :(scenario global_space_with_names)
-% Hide_warnings = true;
+% Hide_errors = true;
 recipe main [
   global-space:address:array:location <- new location:type, 10
   x:number <- copy 23
   1:number/space:global <- copy 24
 ]
-# don't warn that we're mixing numeric addresses and names
-$warn: 0
+# don't complain about mixing numeric addresses and names
+$error: 0
 
 :(after "bool is_numeric_location(const reagent& x)")
   if (is_global(x)) return false;
>













                                              






















                                                                                                 
" random commands used interactively to build mu.arc.t.html

TOhtml
%s,<.*&lt;-.*,<span class="Mu">&</span>,gc
%s/Special">&lt;/Op">\&lt;/g
%s, &lt;-, <span class="Op">&</span>,gc
%s/Constant[^>]*>[^>]*>[: ]literal/Mu&/gc
%s/Constant[^>]*>[^>]*>[: ]offset/Mu&/gc
%s,\<nil literal,<span class="MuConstant">t</span> literal,gc
%s,\<t literal,<span class="MuConstant">t</span> literal,gc
%s,\<nil:literal\>,<span class="MuConstant">nil</span>:literal,gc
%s,\<t:literal\>,<span class="MuConstant">t</span>:literal,gc

map ` :s,[^ ].*,<span class="Mu">&</span>,<CR>
/function.*[
"b = `/<Up><Up><Enter>n
map ; @b
/jump
/break
/reply
/loop
/sleep
/fork
/defer
/label1
/before.*[
/after.*[

  " supercedes
  %s,<.*break.*,<span class="Mu">&</span>,gc
  %s,<.*continue.*,<span class="Mu">&</span>,gc
  %s,<.*reply.*,<span class="Mu">&</span>,gc
  %s,<.*jump.*,<span class="Mu">&</span>,gc
  %s,<.*main.*,<span class="Mu">&</span>,gc
  %s,<.*test1.*,<span class="Mu">&</span>,gc
  %s,<.*test2.*,<span class="Mu">&</span>,gc
  %s,<.*f1.*,<span class="Mu">&</span>,gc
  %s,<.*f2.*,<span class="Mu">&</span>,gc

pre { white-space: pre-wrap; font-family: monospace; color: #aaaaaa; background-color: #000000; }
body { font-family: monospace; color: #aaaaaa; background-color: #000000; }
a { color:#4444ff; }
* { font-size: 1em; }
.Constant, .MuConstant { color: #008080; }
.Comment { color: #8080ff; }
.Delimiter { color: #600060; }
.Normal { color: #aaaaaa; }
.Mu, .Mu .Normal, .Mu .Constant { color: #ffffff; }
.Op { color: #ff8888; }
.CommentedCode { color: #666666; }