diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-03-28 20:57:21 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-03-28 20:57:21 -0700 |
commit | 8f1db754005616054192b3f75e54af9929df26cc (patch) | |
tree | 9cef43e2279326f28c028c126349d929e345b8f5 /cpp/027space | |
parent | 75845d2b1276214ce6c3cbc3504e49cb946d29f0 (diff) | |
download | mu-8f1db754005616054192b3f75e54af9929df26cc.tar.gz |
992 - c++ chain spaces for lexical scope
Diffstat (limited to 'cpp/027space')
-rw-r--r-- | cpp/027space | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/027space b/cpp/027space index 2fa6f36d..0e1686f0 100644 --- a/cpp/027space +++ b/cpp/027space @@ -26,7 +26,7 @@ reagent absolutize(reagent x) { //? cout << "not raw: " << x.to_string() << '\n'; //? 1 assert(x.initialized); reagent r = x; - r.set_value(address(r.value, Current_routine.calls.top().default_space)); + r.set_value(address(r.value, space(r))); //? cout << "after absolutize: " << r.value << '\n'; //? 1 if (r.properties.empty()) r.properties.push_back(pair<string, vector<string> >("", vector<string>())); @@ -35,6 +35,10 @@ reagent absolutize(reagent x) { return r; } +int space(const reagent& x) { + return Current_routine.calls.top().default_space; +} + int address(int offset, int base) { if (base == 0) return offset; // raw return base+offset+1; |