more sever scoping work.
This commit is contained in:
parent
07e43d3f5a
commit
ca7aabd73f
@ -63,7 +63,7 @@ namespace jet {
|
|||||||
return lastConverted;
|
return lastConverted;
|
||||||
}
|
}
|
||||||
|
|
||||||
coreutils::ZString Global::getVariable(coreutils::ZString &variable, std::map<coreutils::ZString, coreutils::MString> &lvariables) {
|
coreutils::ZString Global::getVariable(coreutils::ZString &variable, std::map<coreutils::MString, coreutils::MString> &lvariables) {
|
||||||
if(variable.ifNext("$[")) {
|
if(variable.ifNext("$[")) {
|
||||||
coreutils::MString name;
|
coreutils::MString name;
|
||||||
coreutils::MString modifier;
|
coreutils::MString modifier;
|
||||||
@ -99,7 +99,7 @@ namespace jet {
|
|||||||
throw coreutils::Exception("Expecting a variable initializer ('$[' or '#[').");
|
throw coreutils::Exception("Expecting a variable initializer ('$[' or '#[').");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Global::renderVariableName(coreutils::ZString &variable, coreutils::MString &name, coreutils::MString &modifier, std::map<coreutils::ZString, coreutils::MString> &lvariables) {
|
void Global::renderVariableName(coreutils::ZString &variable, coreutils::MString &name, coreutils::MString &modifier, std::map<coreutils::MString, coreutils::MString> &lvariables) {
|
||||||
while(!variable.ifNext("]")) {
|
while(!variable.ifNext("]")) {
|
||||||
name << variable.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-");
|
name << variable.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-");
|
||||||
if(variable.ifNext(";")) {
|
if(variable.ifNext(";")) {
|
||||||
|
4
Global.h
4
Global.h
@ -20,8 +20,8 @@ namespace jet {
|
|||||||
void addSession(coreutils::MString sessionId, __mysql *mysql);
|
void addSession(coreutils::MString sessionId, __mysql *mysql);
|
||||||
void removeSession(coreutils::MString sessionId);
|
void removeSession(coreutils::MString sessionId);
|
||||||
coreutils::MString& processModifier(coreutils::MString &value, coreutils::MString &modifier);
|
coreutils::MString& processModifier(coreutils::MString &value, coreutils::MString &modifier);
|
||||||
coreutils::ZString getVariable(coreutils::ZString &variable, std::map<coreutils::ZString, coreutils::MString> &lvariables);
|
coreutils::ZString getVariable(coreutils::ZString &variable, std::map<coreutils::MString, coreutils::MString> &lvariables);
|
||||||
void renderVariableName(coreutils::ZString &variable, coreutils::MString &name, coreutils::MString &modifier, std::map<coreutils::ZString, coreutils::MString> &lvariables);
|
void renderVariableName(coreutils::ZString &variable, coreutils::MString &name, coreutils::MString &modifier, std::map<coreutils::MString, coreutils::MString> &lvariables);
|
||||||
__mysql * getSession(coreutils::MString sessionId);
|
__mysql * getSession(coreutils::MString sessionId);
|
||||||
coreutils::ZString getSessionVariable(coreutils::MString &splitName);
|
coreutils::ZString getSessionVariable(coreutils::MString &splitName);
|
||||||
void outputHeaders();
|
void outputHeaders();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
KeywordValue::KeywordValue(coreutils::ZString data, Global &global, std::map<coreutils::ZString, coreutils::MString> &variables) : MString() {
|
KeywordValue::KeywordValue(coreutils::ZString data, Global &global, std::map<coreutils::MString, coreutils::MString> &variables) : MString() {
|
||||||
while(!data.eod()) {
|
while(!data.eod()) {
|
||||||
if(data.startsWith("$[") || data.startsWith("#[")) {
|
if(data.startsWith("$[") || data.startsWith("#[")) {
|
||||||
write(global.getVariable(data, variables));
|
write(global.getVariable(data, variables));
|
||||||
|
@ -13,7 +13,7 @@ namespace jet {
|
|||||||
class KeywordValue : public coreutils::MString {
|
class KeywordValue : public coreutils::MString {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
KeywordValue(coreutils::ZString data, Global &global, std::map<coreutils::ZString, coreutils::MString> &variables);
|
KeywordValue(coreutils::ZString data, Global &global, std::map<coreutils::MString, coreutils::MString> &variables);
|
||||||
virtual ~KeywordValue();
|
virtual ~KeywordValue();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
Operand::Operand(coreutils::ZString &in, Global &global, std::map<coreutils::ZString, coreutils::MString> &lvariables) {
|
Operand::Operand(coreutils::ZString &in, Global &global, std::map<coreutils::MString, coreutils::MString> &lvariables) {
|
||||||
|
|
||||||
doubleValue = 0;
|
doubleValue = 0;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class Operand {
|
class Operand {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Operand(coreutils::ZString &in, Global &global, std::map<coreutils::ZString, coreutils::MString> &lvariables);
|
Operand(coreutils::ZString &in, Global &global, std::map<coreutils::MString, coreutils::MString> &lvariables);
|
||||||
|
|
||||||
bool isNumber;
|
bool isNumber;
|
||||||
|
|
||||||
|
8
Tag.cpp
8
Tag.cpp
@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
Tag::Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName)
|
Tag::Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local, coreutils::ZString splitTagName)
|
||||||
: ZString(in), parentOut(parentOut), global(global), parent(parent) {
|
: ZString(in), parentOut(parentOut), global(global), parent(parent), local(local) {
|
||||||
this->splitTagName = splitTagName;
|
this->splitTagName = splitTagName;
|
||||||
global.errorCursor = in.getCursor();
|
global.errorCursor = in.getCursor();
|
||||||
if(parent && in.ifNext("<")) {
|
if(parent && in.ifNext("<")) {
|
||||||
@ -145,7 +145,7 @@ namespace jet {
|
|||||||
__ifrow _ifrow(in, out, global, this);
|
__ifrow _ifrow(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "include")) {
|
} else if(ifTagName(in, "include")) {
|
||||||
__include _include(in, out, global, parent);
|
__include _include(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "jet")) {
|
} else if(ifTagName(in, "jet")) {
|
||||||
__jet _jet(in, out, global, this);
|
__jet _jet(in, out, global, this);
|
||||||
@ -157,7 +157,7 @@ namespace jet {
|
|||||||
__write _write(in, out, global, this);
|
__write _write(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "set")) {
|
} else if(ifTagName(in, "set")) {
|
||||||
__set _set(in, out, global, parent);
|
__set _set(in, out, global, this);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "call")) {
|
} else if(ifTagName(in, "call")) {
|
||||||
__call _call(in, out, global, this);
|
__call _call(in, out, global, this);
|
||||||
|
5
Tag.h
5
Tag.h
@ -11,15 +11,16 @@ namespace jet {
|
|||||||
class Tag : public coreutils::ZString {
|
class Tag : public coreutils::ZString {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent = NULL, coreutils::ZString splitTagName = "");
|
Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent = NULL, Tag *local = NULL, coreutils::ZString splitTagName = "");
|
||||||
virtual ~Tag();
|
virtual ~Tag();
|
||||||
|
|
||||||
void resolveKeyword(coreutils::ZString keyword);
|
void resolveKeyword(coreutils::ZString keyword);
|
||||||
std::map<coreutils::ZString, coreutils::MString> variables;
|
std::map<coreutils::MString, coreutils::MString> variables;
|
||||||
coreutils::ZString name;
|
coreutils::ZString name;
|
||||||
coreutils::ZString container;
|
coreutils::ZString container;
|
||||||
coreutils::ZString container2;
|
coreutils::ZString container2;
|
||||||
Tag *parent;
|
Tag *parent;
|
||||||
|
Tag *local;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool hasContainer;
|
bool hasContainer;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__call::__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__call::__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, parent) {
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
throw coreutils::Exception("call tag cannot have a container.");
|
throw coreutils::Exception("call tag cannot have a container.");
|
||||||
if(!variableDefined("pgm"))
|
if(!variableDefined("pgm"))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__comment::__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__comment::__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(!hasContainer)
|
if(!hasContainer)
|
||||||
throw coreutils::Exception("comment must have a container.");
|
throw coreutils::Exception("comment must have a container.");
|
||||||
output = false;
|
output = false;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__dotag::__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__dotag::__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
parseContainer(container, containerOut);
|
parseContainer(container, containerOut);
|
||||||
containerOut.reset();
|
containerOut.reset();
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__dump::__dump(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__dump::__dump(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(!variableDefined("file"))
|
if(!variableDefined("file"))
|
||||||
throw coreutils::Exception("file must be sppecified for dump tag.");
|
throw coreutils::Exception("file must be sppecified for dump tag.");
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__for::__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__for::__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
double counter = 0.0f;
|
double counter = 0.0f;
|
||||||
bool nameDefined = variableDefined("name");
|
bool nameDefined = variableDefined("name");
|
||||||
if(variableDefined("start")) {
|
if(variableDefined("start")) {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__header::__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__header::__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, parent) {
|
||||||
output = false;
|
output = false;
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
throw coreutils::Exception("header tag must have name defined.");
|
throw coreutils::Exception("header tag must have name defined.");
|
||||||
|
2
__if.cpp
2
__if.cpp
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__if::__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, "else") {
|
__if::__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this, "else") {
|
||||||
|
|
||||||
coreutils::MString result;
|
coreutils::MString result;
|
||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, "else") {
|
__ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this, "else") {
|
||||||
output = false;
|
output = false;
|
||||||
if(!hasContainer)
|
if(!hasContainer)
|
||||||
throw coreutils::Exception("ifrow tag must have a container.");
|
throw coreutils::Exception("ifrow tag must have a container.");
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__include::__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__include::__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, parent) {
|
||||||
resolveContainerParent = true;
|
|
||||||
if(!variableDefined("file"))
|
if(!variableDefined("file"))
|
||||||
throw coreutils::Exception("file keyword must be specified.");
|
throw coreutils::Exception("file keyword must be specified.");
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(variableDefined("cgi"))
|
if(variableDefined("cgi"))
|
||||||
resolveKeyword("cgi");
|
resolveKeyword("cgi");
|
||||||
if(variables["cgi"] == "true") {
|
if(variables["cgi"] == "true") {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__mysql::__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__mysql::__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
|
|
||||||
if(!variableDefined("host"))
|
if(!variableDefined("host"))
|
||||||
throw coreutils::Exception("host must be specified for mysql tag.");
|
throw coreutils::Exception("host must be specified for mysql tag.");
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__read::__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__read::__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(!variableDefined("file"))
|
if(!variableDefined("file"))
|
||||||
throw coreutils::Exception("file keyword must be specified.");
|
throw coreutils::Exception("file keyword must be specified.");
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
|
18
__set.cpp
18
__set.cpp
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
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;
|
output = false;
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
throw coreutils::Exception("set tag must have name defined.");
|
throw coreutils::Exception("set tag must have name defined.");
|
||||||
@ -27,34 +27,34 @@ namespace jet {
|
|||||||
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
if(!variableDefined("scope") || (variables["scope"] == "global"))
|
||||||
global.variables[variables["name"]] = Operand(variables["expr"], global, parent->variables).string;
|
global.variables[variables["name"]] = Operand(variables["expr"], global, parent->variables).string;
|
||||||
else if(variables["scope"] == "local")
|
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")
|
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) {
|
} 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")
|
||||||
parent->variables[variables["name"]] = out;
|
local->variables[variables["name"]] = out;
|
||||||
else if(variables["scope"] == "parent")
|
else if(variables["scope"] == "parent")
|
||||||
parent->parent->variables[variables["name"]] = out;
|
local->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;
|
local->variables[variables["name"]] = container;
|
||||||
else if(variables["scope"] == "parent")
|
else if(variables["scope"] == "parent")
|
||||||
parent->parent->variables[variables["name"]] = container;
|
local->parent->variables[variables["name"]] = container;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
resolveKeyword("value");
|
resolveKeyword("value");
|
||||||
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"];
|
local->variables[variables["name"]] = variables["value"];
|
||||||
else if(variables["scope"] == "parent")
|
else if(variables["scope"] == "parent")
|
||||||
parent->parent->variables[variables["name"]] = variables["value"];
|
local->parent->variables[variables["name"]] = variables["value"];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__sql::__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__sql::__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, parent) {
|
||||||
output = false;
|
output = false;
|
||||||
if(!hasContainer)
|
if(!hasContainer)
|
||||||
throw coreutils::Exception("sql tag must have a container.");
|
throw coreutils::Exception("sql tag must have a container.");
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__stream::__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__stream::__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
throw coreutils::Exception("stream tag must have a file name to stream.");
|
throw coreutils::Exception("stream tag must have a file name to stream.");
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__system::__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__system::__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, parent) {
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
throw coreutils::Exception("system tag cannot have a container.");
|
throw coreutils::Exception("system tag cannot have a container.");
|
||||||
if(!variableDefined(coreutils::ZString("cmd")))
|
if(!variableDefined(coreutils::ZString("cmd")))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__tag::__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__tag::__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, this) {
|
||||||
evaluate = false;
|
evaluate = false;
|
||||||
output = false;
|
output = false;
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__until::__until(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__until::__until(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
|
|
||||||
coreutils::MString result;
|
coreutils::MString result;
|
||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__while::__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__while::__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
|
|
||||||
coreutils::MString result;
|
coreutils::MString result;
|
||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__whiledir::__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__whiledir::__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(!variableDefined("path"))
|
if(!variableDefined("path"))
|
||||||
throw coreutils::Exception("whiledir tag must specify a path.");
|
throw coreutils::Exception("whiledir tag must specify a path.");
|
||||||
resolveKeyword("path");
|
resolveKeyword("path");
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__write::__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__write::__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this) {
|
||||||
output = false;
|
output = false;
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
int len;
|
int len;
|
||||||
|
29
tests/dump.txt
Normal file
29
tests/dump.txt
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
*** CGI VARIABLES ***
|
||||||
|
*** GLOBAL VARIABLES ***
|
||||||
|
=[xxx]
|
||||||
|
addition=[8]
|
||||||
|
complete=[ABCD;tohex]
|
||||||
|
division=[1.666666666667]
|
||||||
|
divisor=[8]
|
||||||
|
error=[]
|
||||||
|
include=[yes]
|
||||||
|
ix=[1]
|
||||||
|
lefty=[01234]
|
||||||
|
modified1=[ABCD]
|
||||||
|
multiplication=[15]
|
||||||
|
nested=[64]
|
||||||
|
newname=[another container value]
|
||||||
|
noeval=[this is the value store in #[name1].]
|
||||||
|
nonexistant=[]
|
||||||
|
numbers=[0123456789]
|
||||||
|
subtraction=[2]
|
||||||
|
testinclude=[xThis is a container set with ''x]
|
||||||
|
theexpr=[bcd]
|
||||||
|
thename=[this is the value store in .]
|
||||||
|
tohex=[tohex]
|
||||||
|
varname1=[vardata]
|
||||||
|
x=[]
|
||||||
|
*** LOCAL VARIABLES ***
|
||||||
|
file=[./testinclude.jet]
|
||||||
|
localvar=[This is a container set with '']
|
||||||
|
name1=[]
|
@ -4,3 +4,4 @@ localname='#[name1]'
|
|||||||
<set name="include" value="yes" />
|
<set name="include" value="yes" />
|
||||||
<set name="testinclude" value="x#[localvar]x" />
|
<set name="testinclude" value="x#[localvar]x" />
|
||||||
test='$[testinclude]'
|
test='$[testinclude]'
|
||||||
|
<dump file="./dump.txt" />
|
@ -1,8 +1,10 @@
|
|||||||
#!../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="name2" value="localname2" scope="local" />
|
<set name="name2" value="localname2" scope="local" />
|
||||||
|
<set name="name3" value="global" />
|
||||||
<set name="x" value="#[name1]" />
|
<set name="x" value="#[name1]" />
|
||||||
localname=#[name1]
|
localname=#[name1]
|
||||||
localname2=#[name2]
|
localname2=#[name2]
|
||||||
localname through x=$[x]
|
localname through x=$[x]
|
||||||
|
<dump file="./dump.txt" />
|
||||||
</jet>
|
</jet>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user