more sever scoping work.
This commit is contained in:
1 parent
07e43d3f5a
commit
ca7aabd73f
32 files changed
+76
-44
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace jet {
|
||||
|
||||
__set::__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
||||
__set::__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, parent) {
|
||||
output = false;
|
||||
if(!variableDefined("name"))
|
||||
throw coreutils::Exception("set tag must have name defined.");
|
||||
@@ -27,34 +27,34 @@ namespace jet {
|
||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||
global.variables[variables["name"]] = Operand(variables["expr"], global, parent->variables).string;
|
||||
else if(variables["scope"] == "local")
|
||||
parent->variables[variables["name"]] = Operand(variables["expr"], global, parent->variables).string;
|
||||
local->variables[variables["name"]] = Operand(variables["expr"], global, parent->variables).string;
|
||||
else if(variables["scope"] == "parent")
|
||||
parent->parent->variables[variables["name"]] = Operand(variables["expr"], global, parent->variables).string;
|
||||
local->parent->variables[variables["name"]] = Operand(variables["expr"], global, parent->variables).string;
|
||||
} else if(hasContainer) {
|
||||
processContainer(container);
|
||||
if(evaluate) {
|
||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||
global.variables[variables["name"]] = out;
|
||||
else if(variables["scope"] == "local")
|
||||
parent->variables[variables["name"]] = out;
|
||||
local->variables[variables["name"]] = out;
|
||||
else if(variables["scope"] == "parent")
|
||||
parent->parent->variables[variables["name"]] = out;
|
||||
local->parent->variables[variables["name"]] = out;
|
||||
} else {
|
||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||
global.variables[variables["name"]] = container;
|
||||
else if(variables["scope"] == "local")
|
||||
parent->variables[variables["name"]] = container;
|
||||
local->variables[variables["name"]] = container;
|
||||
else if(variables["scope"] == "parent")
|
||||
parent->parent->variables[variables["name"]] = container;
|
||||
local->parent->variables[variables["name"]] = container;
|
||||
}
|
||||
} else {
|
||||
resolveKeyword("value");
|
||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||
global.variables[variables["name"]] = variables["value"];
|
||||
else if(variables["scope"] == "local")
|
||||
parent->variables[variables["name"]] = variables["value"];
|
||||
local->variables[variables["name"]] = variables["value"];
|
||||
else if(variables["scope"] == "parent")
|
||||
parent->parent->variables[variables["name"]] = variables["value"];
|
||||
local->parent->variables[variables["name"]] = variables["value"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user