Fixed the scope="local" on set tag.
This commit is contained in:
parent
ae4ff5a3dc
commit
9dcedd302b
3
Tag.h
3
Tag.h
@ -13,6 +13,8 @@ namespace jet {
|
|||||||
public:
|
public:
|
||||||
Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName = "");
|
Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName = "");
|
||||||
virtual ~Tag();
|
virtual ~Tag();
|
||||||
|
|
||||||
|
std::map<coreutils::ZString, coreutils::MString> variables;
|
||||||
coreutils::ZString name;
|
coreutils::ZString name;
|
||||||
coreutils::ZString container;
|
coreutils::ZString container;
|
||||||
coreutils::ZString container2;
|
coreutils::ZString container2;
|
||||||
@ -20,7 +22,6 @@ namespace jet {
|
|||||||
protected:
|
protected:
|
||||||
bool hasContainer;
|
bool hasContainer;
|
||||||
bool hasContainer2;
|
bool hasContainer2;
|
||||||
std::map<coreutils::ZString, coreutils::MString> variables;
|
|
||||||
bool variableDefined(coreutils::ZString variable);
|
bool variableDefined(coreutils::ZString variable);
|
||||||
void parseContainer(coreutils::ZString &in, coreutils::ZString container2 = NULL);
|
void parseContainer(coreutils::ZString &in, coreutils::ZString container2 = NULL);
|
||||||
void processContainer(coreutils::ZString &container, coreutils::ZString container2 = NULL);
|
void processContainer(coreutils::ZString &container, coreutils::ZString container2 = NULL);
|
||||||
|
@ -24,25 +24,25 @@ namespace jet {
|
|||||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||||
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")
|
||||||
variables[variables["name"]] = Operand(variables["expr"]).string;
|
parent->variables[variables["name"]] = Operand(variables["expr"]).string;
|
||||||
} else if(hasContainer) {
|
} else if(hasContainer) {
|
||||||
processContainer(container);
|
processContainer(container);
|
||||||
if(evaluate) {
|
if(evaluate) {
|
||||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||||
global.variables[variables["name"]] = out;
|
global.variables[variables["name"]] = out;
|
||||||
else if(variables["scope"] == "local")
|
else if(variables["scope"] == "local")
|
||||||
variables[variables["name"]] = out;
|
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")
|
||||||
variables[variables["name"]] = container;
|
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")
|
||||||
variables[variables["name"]] = variables["value"];
|
parent->variables[variables["name"]] = variables["value"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!./jet-2.0
|
#!../jet-2.0
|
||||||
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
|
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
|
||||||
<set name="testvar" value="do you see this" scope="local" />
|
<set name="testvar" value="do you see this" scope="local" />
|
||||||
#[testvar]
|
#[testvar]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user