Added scope="parent" to set tag.
This commit is contained in:
parent
489f1d6915
commit
169ad1aa11
2
Tag.h
2
Tag.h
@ -18,6 +18,7 @@ namespace jet {
|
|||||||
coreutils::ZString name;
|
coreutils::ZString name;
|
||||||
coreutils::ZString container;
|
coreutils::ZString container;
|
||||||
coreutils::ZString container2;
|
coreutils::ZString container2;
|
||||||
|
Tag *parent;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool hasContainer;
|
bool hasContainer;
|
||||||
@ -28,7 +29,6 @@ namespace jet {
|
|||||||
void copyContainer(coreutils::ZString &in, coreutils::MString &out);
|
void copyContainer(coreutils::ZString &in, coreutils::MString &out);
|
||||||
|
|
||||||
Global &global;
|
Global &global;
|
||||||
Tag *parent;
|
|
||||||
|
|
||||||
coreutils::MString &parentOut;
|
coreutils::MString &parentOut;
|
||||||
coreutils::MString out;
|
coreutils::MString out;
|
||||||
|
@ -25,6 +25,8 @@ namespace jet {
|
|||||||
global.variables[variables["name"]] = Operand(variables["expr"]).string;
|
global.variables[variables["name"]] = Operand(variables["expr"]).string;
|
||||||
else if(variables["scope"] == "local")
|
else if(variables["scope"] == "local")
|
||||||
parent->variables[variables["name"]] = Operand(variables["expr"]).string;
|
parent->variables[variables["name"]] = Operand(variables["expr"]).string;
|
||||||
|
else if(variables["scope"] == "parent")
|
||||||
|
parent->parent->variables[variables["name"]] = Operand(variables["expr"]).string;
|
||||||
} else if(hasContainer) {
|
} else if(hasContainer) {
|
||||||
processContainer(container);
|
processContainer(container);
|
||||||
if(evaluate) {
|
if(evaluate) {
|
||||||
@ -32,17 +34,23 @@ namespace jet {
|
|||||||
global.variables[variables["name"]] = out;
|
global.variables[variables["name"]] = out;
|
||||||
else if(variables["scope"] == "local")
|
else if(variables["scope"] == "local")
|
||||||
parent->variables[variables["name"]] = out;
|
parent->variables[variables["name"]] = out;
|
||||||
|
else if(variables["scope"] == "parent")
|
||||||
|
parent->parent->variables[variables["name"]] = out;
|
||||||
} else {
|
} else {
|
||||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||||
global.variables[variables["name"]] = container;
|
global.variables[variables["name"]] = container;
|
||||||
else if(variables["scope"] == "local")
|
else if(variables["scope"] == "local")
|
||||||
parent->variables[variables["name"]] = container;
|
parent->variables[variables["name"]] = container;
|
||||||
|
else if(variables["scope"] == "parent")
|
||||||
|
parent->parent->variables[variables["name"]] = container;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||||
global.variables[variables["name"]] = variables["value"];
|
global.variables[variables["name"]] = variables["value"];
|
||||||
else if(variables["scope"] == "local")
|
else if(variables["scope"] == "local")
|
||||||
parent->variables[variables["name"]] = variables["value"];
|
parent->variables[variables["name"]] = variables["value"];
|
||||||
|
else if(variables["scope"] == "parent")
|
||||||
|
parent->parent->variables[variables["name"]] = variables["value"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user