major scope work completed. Works well!!!
This commit is contained in:
parent
90d7d07e7e
commit
6d2da98024
51
Tag.cpp
51
Tag.cpp
@ -110,7 +110,7 @@ namespace jet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Tag::resolveKeyword(coreutils::ZString keyword) {
|
void Tag::resolveKeyword(coreutils::ZString keyword) {
|
||||||
variables[keyword] = KeywordValue(variables[keyword], global, parent->variables);
|
variables[keyword] = KeywordValue(variables[keyword], global, parent->local->variables);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tag::processContainer(coreutils::ZString &container) {
|
void Tag::processContainer(coreutils::ZString &container) {
|
||||||
@ -124,70 +124,70 @@ namespace jet {
|
|||||||
while(!in.eod()) {
|
while(!in.eod()) {
|
||||||
if(in.startsWith("<")) {
|
if(in.startsWith("<")) {
|
||||||
if(ifTagName(in, "mysql")) {
|
if(ifTagName(in, "mysql")) {
|
||||||
__mysql _mysql(in, out, global, this);
|
__mysql _mysql(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "comment")) {
|
} else if(ifTagName(in, "comment")) {
|
||||||
__comment _comment(in, out, global, this);
|
__comment _comment(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "sql")) {
|
} else if(ifTagName(in, "sql")) {
|
||||||
__sql _sql(in, out, global, this);
|
__sql _sql(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "whilerow")) {
|
} else if(ifTagName(in, "whilerow")) {
|
||||||
__whilerow _whilerow(in, out, global, this);
|
__whilerow _whilerow(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "for")) {
|
} else if(ifTagName(in, "for")) {
|
||||||
__for _for(in, out, global, this);
|
__for _for(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "if")) {
|
} else if(ifTagName(in, "if")) {
|
||||||
__if _if(in, out, global, this);
|
__if _if(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "ifrow")) {
|
} else if(ifTagName(in, "ifrow")) {
|
||||||
__ifrow _ifrow(in, out, global, this);
|
__ifrow _ifrow(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "include")) {
|
} else if(ifTagName(in, "include")) {
|
||||||
__include _include(in, out, global, this);
|
__include _include(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "jet")) {
|
} else if(ifTagName(in, "jet")) {
|
||||||
__jet _jet(in, out, global, this);
|
__jet _jet(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "read")) {
|
} else if(ifTagName(in, "read")) {
|
||||||
__read _read(in, out, global, this);
|
__read _read(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "write")) {
|
} else if(ifTagName(in, "write")) {
|
||||||
__write _write(in, out, global, this);
|
__write _write(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "set")) {
|
} else if(ifTagName(in, "set")) {
|
||||||
__set _set(in, out, global, this);
|
__set _set(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "call")) {
|
} else if(ifTagName(in, "call")) {
|
||||||
__call _call(in, out, global, this);
|
__call _call(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "system")) {
|
} else if(ifTagName(in, "system")) {
|
||||||
__system _system(in, out, global, this);
|
__system _system(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "while")) {
|
} else if(ifTagName(in, "while")) {
|
||||||
__while _while(in, out, global, this);
|
__while _while(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "until")) {
|
} else if(ifTagName(in, "until")) {
|
||||||
__until _until(in, out, global, this);
|
__until _until(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "header")) {
|
} else if(ifTagName(in, "header")) {
|
||||||
__header _header(in, out, global, this);
|
__header _header(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "whiledir")) {
|
} else if(ifTagName(in, "whiledir")) {
|
||||||
__whiledir _whiledir(in, out, global, this);
|
__whiledir _whiledir(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "stream")) {
|
} else if(ifTagName(in, "stream")) {
|
||||||
__stream _stream(in, out, global, this);
|
__stream _stream(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "dump")) {
|
} else if(ifTagName(in, "dump")) {
|
||||||
__dump _dump(in, out, global, this);
|
__dump _dump(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "tag")) {
|
} else if(ifTagName(in, "tag")) {
|
||||||
__tag _tag(in, out, global, this);
|
__tag _tag(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagDefined(in, tag)) {
|
} else if(ifTagDefined(in, tag)) {
|
||||||
__dotag _dotag(in, out, global, this);
|
__dotag _dotag(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "container")) {
|
} else if(ifTagName(in, "container")) {
|
||||||
while(!containerOut.eod())
|
while(!containerOut.eod())
|
||||||
@ -202,10 +202,7 @@ namespace jet {
|
|||||||
}
|
}
|
||||||
} else if(in.startsWith("$[") || in.startsWith("#[")) {
|
} else if(in.startsWith("$[") || in.startsWith("#[")) {
|
||||||
global.errorCursor = in.getCursor();
|
global.errorCursor = in.getCursor();
|
||||||
if(resolveContainerParent)
|
out.write(global.getVariable(in, local->variables));
|
||||||
out.write(global.getVariable(in, parent->variables));
|
|
||||||
else
|
|
||||||
out.write(global.getVariable(in, local->variables));
|
|
||||||
} else {
|
} else {
|
||||||
out.write(in.nextChar());
|
out.write(in.nextChar());
|
||||||
}
|
}
|
||||||
|
1
Tag.h
1
Tag.h
@ -41,7 +41,6 @@ namespace jet {
|
|||||||
bool filterBlankLines = false;
|
bool filterBlankLines = false;
|
||||||
bool trimLines = false;
|
bool trimLines = false;
|
||||||
bool cleanWhitespace = false;
|
bool cleanWhitespace = false;
|
||||||
bool resolveContainerParent = false;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool containerOnly = false;
|
bool containerOnly = false;
|
||||||
|
@ -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, parent) {
|
__call::__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
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"))
|
||||||
|
2
__call.h
2
__call.h
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __call : public Tag {
|
class __call : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int pid;
|
int pid;
|
||||||
|
@ -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, this) {
|
__comment::__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : 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;
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __comment : public Tag {
|
class __comment : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__dotag::__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(hasContainer)
|
if(hasContainer)
|
||||||
parseContainer(container, containerOut);
|
parseContainer(container, containerOut);
|
||||||
containerOut.reset();
|
containerOut.reset();
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __dotag : public Tag {
|
class __dotag : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__dump::__dump(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
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.");
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ namespace jet {
|
|||||||
|
|
||||||
outFile << "*** LOCAL VARIABLES ***" << std::endl;
|
outFile << "*** LOCAL VARIABLES ***" << std::endl;
|
||||||
|
|
||||||
for (auto i = parent->variables.begin(); i != parent->variables.end(); i++)
|
for (auto i = local->variables.begin(); i != local->variables.end(); i++)
|
||||||
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
outFile << i->first << "=[" << i->second << "]" << std::endl;
|
||||||
|
|
||||||
outFile.close();
|
outFile.close();
|
||||||
|
2
__dump.h
2
__dump.h
@ -10,7 +10,7 @@ namespace jet {
|
|||||||
class __dump : public Tag {
|
class __dump : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__dump(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__dump(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__for::__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : 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")) {
|
||||||
|
2
__for.h
2
__for.h
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __for : public Tag {
|
class __for : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, parent) {
|
__header::__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
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.");
|
||||||
|
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __header : public Tag {
|
class __header : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
5
__if.cpp
5
__if.cpp
@ -5,11 +5,9 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__if::__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, this, "else") {
|
__if::__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this, "else") {
|
||||||
|
|
||||||
coreutils::MString result;
|
coreutils::MString result;
|
||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
|
||||||
if(variableDefined("value1")) {
|
if(variableDefined("value1")) {
|
||||||
resolveKeyword("value1");
|
resolveKeyword("value1");
|
||||||
if(variableDefined("expr"))
|
if(variableDefined("expr"))
|
||||||
@ -42,7 +40,6 @@ namespace jet {
|
|||||||
processContainer(container);
|
processContainer(container);
|
||||||
else if(hasContainer2)
|
else if(hasContainer2)
|
||||||
processContainer(container2);
|
processContainer(container2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
2
__if.h
2
__if.h
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __if : public Tag {
|
class __if : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this, "else") {
|
__ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : 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.");
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __ifrow : public Tag {
|
class __ifrow : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__include::__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, parent) {
|
__include::__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
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)
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __include : public Tag {
|
class __include : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||||
if(variableDefined("cgi"))
|
if(variableDefined("cgi"))
|
||||||
resolveKeyword("cgi");
|
resolveKeyword("cgi");
|
||||||
if(variables["cgi"] == "true") {
|
if(variables["cgi"] == "true") {
|
||||||
|
2
__jet.h
2
__jet.h
@ -12,7 +12,7 @@ namespace jet {
|
|||||||
class __jet : public Tag {
|
class __jet : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__mysql::__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : 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.");
|
||||||
|
@ -12,7 +12,7 @@ namespace jet {
|
|||||||
class __mysql : public Tag {
|
class __mysql : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
~__mysql();
|
~__mysql();
|
||||||
|
|
||||||
void query(coreutils::MString query);
|
void query(coreutils::MString query);
|
||||||
|
@ -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, this) {
|
__read::__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : 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"))
|
||||||
|
2
__read.h
2
__read.h
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __read : public Tag {
|
class __read : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -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, parent) {
|
__set::__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
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.");
|
||||||
|
2
__set.h
2
__set.h
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __set : public Tag {
|
class __set : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -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, parent) {
|
__sql::__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
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.");
|
||||||
|
2
__sql.h
2
__sql.h
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __sql : public Tag {
|
class __sql : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__stream::__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : 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.");
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __stream : public Tag {
|
class __stream : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, parent) {
|
__system::__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
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")))
|
||||||
|
@ -8,7 +8,7 @@ namespace jet {
|
|||||||
class __system : public Tag {
|
class __system : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int pid;
|
int pid;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__tag::__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, this) {
|
__tag::__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, this, this) {
|
||||||
evaluate = false;
|
evaluate = false;
|
||||||
output = false;
|
output = false;
|
||||||
if(!variableDefined("name"))
|
if(!variableDefined("name"))
|
||||||
|
2
__tag.h
2
__tag.h
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __tag : public Tag {
|
class __tag : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
std::map<coreutils::MString, coreutils::MString> tags;
|
std::map<coreutils::MString, coreutils::MString> tags;
|
||||||
|
|
||||||
|
@ -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, this) {
|
__until::__until(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||||
|
|
||||||
coreutils::MString result;
|
coreutils::MString result;
|
||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __until : public Tag {
|
class __until : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__until(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__until(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__while::__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
|
||||||
|
|
||||||
coreutils::MString result;
|
coreutils::MString result;
|
||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
@ -9,7 +9,7 @@ namespace jet {
|
|||||||
class __while : public Tag {
|
class __while : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__whiledir::__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : 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");
|
||||||
|
@ -10,7 +10,7 @@ namespace jet {
|
|||||||
class __whiledir : public Tag {
|
class __whiledir : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
__whilerow::__whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) {
|
__whilerow::__whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
|
|
||||||
int count = variables["count"].asInteger();
|
int count = variables["count"].asInteger();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace jet {
|
|||||||
class __whilerow : public Tag {
|
class __whilerow : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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, this) {
|
__write::__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
||||||
output = false;
|
output = false;
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
int len;
|
int len;
|
||||||
|
@ -11,7 +11,7 @@ namespace jet {
|
|||||||
class __write : public Tag {
|
class __write : public Tag {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent);
|
__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
try {
|
try {
|
||||||
coreutils::MString out;
|
coreutils::MString out;
|
||||||
global.errorCursor = data.getCursor();
|
global.errorCursor = data.getCursor();
|
||||||
jet::__jet *jet = new jet::__jet(data, out, global, NULL);
|
jet::__jet *jet = new jet::__jet(data, out, global, NULL, NULL);
|
||||||
delete jet;
|
delete jet;
|
||||||
global.outputHeaders();
|
global.outputHeaders();
|
||||||
std::cout << out;
|
std::cout << out;
|
||||||
|
@ -17,14 +17,15 @@ noeval=[this is the value store in #[name1].]
|
|||||||
nonexistant=[]
|
nonexistant=[]
|
||||||
numbers=[0123456789]
|
numbers=[0123456789]
|
||||||
subtraction=[2]
|
subtraction=[2]
|
||||||
testinclude=[]
|
|
||||||
theexpr=[bcd]
|
theexpr=[bcd]
|
||||||
thename=[this is the value store in localname.]
|
thename=[this is the value store in localname.]
|
||||||
tohex=[tohex]
|
tohex=[tohex]
|
||||||
varname1=[vardata]
|
varname1=[vardata]
|
||||||
x=[]
|
x=[]
|
||||||
*** LOCAL VARIABLES ***
|
*** LOCAL VARIABLES ***
|
||||||
file=[./testinclude.jet]
|
cgi=[true]
|
||||||
localvar=[This is a container set with '']
|
filterblanklines=[true]
|
||||||
name1=[]
|
localvar=[This is a container set with 'localname']
|
||||||
testinclude=[xThis is a container set with ''x]
|
name1=[localname]
|
||||||
|
testinclude=[xThis is a container set with 'localname'x]
|
||||||
|
trimlines=[true]
|
||||||
|
@ -3,5 +3,5 @@ This is from an include tag.
|
|||||||
localname='#[name1]'
|
localname='#[name1]'
|
||||||
<set name="include" value="yes" />
|
<set name="include" value="yes" />
|
||||||
<set name="testinclude" value="x#[localvar]x" scope="local" />
|
<set name="testinclude" value="x#[localvar]x" scope="local" />
|
||||||
test='$[testinclude]'
|
test='#[testinclude]'
|
||||||
<dump file="./dump.txt" />
|
<dump file="./dump.txt" />
|
Loading…
x
Reference in New Issue
Block a user