From 76755b2836b0dadd88f82635f661f9d9df77604d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 10 Nov 2015 21:35:42 -0800 Subject: 2423 - describe shape-shifting in html docs --- html/045space_surround.cc.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'html/045space_surround.cc.html') diff --git a/html/045space_surround.cc.html b/html/045space_surround.cc.html index 6ceb3696..da74d215 100644 --- a/html/045space_surround.cc.html +++ b/html/045space_surround.cc.html @@ -13,8 +13,8 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } -.cSpecial { color: #008000; } .traceContains { color: #008000; } +.cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } .Special { color: #ff6060; } @@ -42,11 +42,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } recipe main [ 10:number <- copy 5 # pretend array 20:number <- copy 5 # pretend array - default-space:address:array:location <- copy 10 - 0:address:array:location/names:dummy <- copy 20 # later layers will explain the /names: property + default-space:address:array:location <- copy 10/raw + 0:address:array:location/names:dummy <- copy 20/raw # later layers will explain the /names: property 1:number <- copy 32 1:number/space:1 <- copy 33 ] +recipe dummy [ +] # chain space +mem: storing 20 in location 11 # store to default-space @@ -60,23 +62,23 @@ recipe main [ :(replace{} "long long int space_base(const reagent& x)") long long int space_base(const reagent& x) { - return space_base(x, space_index(x), Current_routine->calls.front().default_space); + return space_base(x, space_index(x), current_call().default_space); } long long int space_base(const reagent& x, long long int space_index, long long int base) { if (space_index == 0) { return base; } - long long int result = space_base(x, space_index-1, Memory[base+1]); + long long int result = space_base(x, space_index-1, get_or_insert(Memory, base+1)); return result; } long long int space_index(const reagent& x) { for (long long int i = /*skip name:type*/1; i < SIZE(x.properties); ++i) { if (x.properties.at(i).first == "space") { - if (SIZE(x.properties.at(i).second) != 1) - raise << current_recipe_name() << ": /space metadata should take exactly one value in " << x.original_string << '\n' << end(); - return to_integer(x.properties.at(i).second.at(0)); + if (!x.properties.at(i).second || x.properties.at(i).second->right) + raise_error << maybe(current_recipe_name()) << "/space metadata should take exactly one value in " << x.original_string << '\n' << end(); + return to_integer(x.properties.at(i).second->value); } } return 0; -- cgit 1.4.1-2-gfad0