diff --git a/Tag.cpp b/Tag.cpp index ecfe55d..90ee5d7 100644 --- a/Tag.cpp +++ b/Tag.cpp @@ -110,7 +110,7 @@ namespace jet { } 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) { @@ -124,70 +124,70 @@ namespace jet { while(!in.eod()) { if(in.startsWith("<")) { if(ifTagName(in, "mysql")) { - __mysql _mysql(in, out, global, this); + __mysql _mysql(in, out, global, this, local); continue; } else if(ifTagName(in, "comment")) { - __comment _comment(in, out, global, this); + __comment _comment(in, out, global, this, local); continue; } else if(ifTagName(in, "sql")) { - __sql _sql(in, out, global, this); + __sql _sql(in, out, global, this, local); continue; } else if(ifTagName(in, "whilerow")) { - __whilerow _whilerow(in, out, global, this); + __whilerow _whilerow(in, out, global, this, local); continue; } else if(ifTagName(in, "for")) { - __for _for(in, out, global, this); + __for _for(in, out, global, this, local); continue; } else if(ifTagName(in, "if")) { - __if _if(in, out, global, this); + __if _if(in, out, global, this, local); continue; } else if(ifTagName(in, "ifrow")) { - __ifrow _ifrow(in, out, global, this); + __ifrow _ifrow(in, out, global, this, local); continue; } else if(ifTagName(in, "include")) { - __include _include(in, out, global, this); + __include _include(in, out, global, this, local); continue; } else if(ifTagName(in, "jet")) { - __jet _jet(in, out, global, this); + __jet _jet(in, out, global, this, local); continue; } else if(ifTagName(in, "read")) { - __read _read(in, out, global, this); + __read _read(in, out, global, this, local); continue; } else if(ifTagName(in, "write")) { - __write _write(in, out, global, this); + __write _write(in, out, global, this, local); continue; } else if(ifTagName(in, "set")) { - __set _set(in, out, global, this); + __set _set(in, out, global, this, local); continue; } else if(ifTagName(in, "call")) { - __call _call(in, out, global, this); + __call _call(in, out, global, this, local); continue; } else if(ifTagName(in, "system")) { - __system _system(in, out, global, this); + __system _system(in, out, global, this, local); continue; } else if(ifTagName(in, "while")) { - __while _while(in, out, global, this); + __while _while(in, out, global, this, local); continue; } else if(ifTagName(in, "until")) { - __until _until(in, out, global, this); + __until _until(in, out, global, this, local); continue; } else if(ifTagName(in, "header")) { - __header _header(in, out, global, this); + __header _header(in, out, global, this, local); continue; } else if(ifTagName(in, "whiledir")) { - __whiledir _whiledir(in, out, global, this); + __whiledir _whiledir(in, out, global, this, local); continue; } else if(ifTagName(in, "stream")) { - __stream _stream(in, out, global, this); + __stream _stream(in, out, global, this, local); continue; } else if(ifTagName(in, "dump")) { - __dump _dump(in, out, global, this); + __dump _dump(in, out, global, this, local); continue; } else if(ifTagName(in, "tag")) { - __tag _tag(in, out, global, this); + __tag _tag(in, out, global, this, local); continue; } else if(ifTagDefined(in, tag)) { - __dotag _dotag(in, out, global, this); + __dotag _dotag(in, out, global, this, local); continue; } else if(ifTagName(in, "container")) { while(!containerOut.eod()) @@ -202,10 +202,7 @@ namespace jet { } } else if(in.startsWith("$[") || in.startsWith("#[")) { global.errorCursor = in.getCursor(); - if(resolveContainerParent) - out.write(global.getVariable(in, parent->variables)); - else - out.write(global.getVariable(in, local->variables)); + out.write(global.getVariable(in, local->variables)); } else { out.write(in.nextChar()); } diff --git a/Tag.h b/Tag.h index 63a746d..07d1254 100644 --- a/Tag.h +++ b/Tag.h @@ -41,7 +41,6 @@ namespace jet { bool filterBlankLines = false; bool trimLines = false; bool cleanWhitespace = false; - bool resolveContainerParent = false; private: bool containerOnly = false; diff --git a/__call.cpp b/__call.cpp index 6d8c350..242d432 100644 --- a/__call.cpp +++ b/__call.cpp @@ -9,7 +9,7 @@ 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) throw coreutils::Exception("call tag cannot have a container."); if(!variableDefined("pgm")) diff --git a/__call.h b/__call.h index 6cd0edb..3fa6bb9 100644 --- a/__call.h +++ b/__call.h @@ -8,7 +8,7 @@ namespace jet { class __call : public Tag { 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: int pid; diff --git a/__comment.cpp b/__comment.cpp index e5a604b..e64bc02 100644 --- a/__comment.cpp +++ b/__comment.cpp @@ -3,7 +3,7 @@ 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) throw coreutils::Exception("comment must have a container."); output = false; diff --git a/__comment.h b/__comment.h index 52a2f78..3d140db 100644 --- a/__comment.h +++ b/__comment.h @@ -8,7 +8,7 @@ namespace jet { class __comment : public Tag { 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); }; diff --git a/__dotag.cpp b/__dotag.cpp index 8cb66fb..15eaec2 100644 --- a/__dotag.cpp +++ b/__dotag.cpp @@ -3,7 +3,7 @@ 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) parseContainer(container, containerOut); containerOut.reset(); diff --git a/__dotag.h b/__dotag.h index 42b3b12..386786d 100644 --- a/__dotag.h +++ b/__dotag.h @@ -9,7 +9,7 @@ namespace jet { class __dotag : public Tag { 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); }; diff --git a/__dump.cpp b/__dump.cpp index 59e4352..25c8476 100644 --- a/__dump.cpp +++ b/__dump.cpp @@ -5,7 +5,7 @@ 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")) throw coreutils::Exception("file must be sppecified for dump tag."); @@ -23,7 +23,7 @@ namespace jet { 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.close(); diff --git a/__dump.h b/__dump.h index 7d75db5..b44285e 100644 --- a/__dump.h +++ b/__dump.h @@ -10,7 +10,7 @@ namespace jet { class __dump : public Tag { 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); }; diff --git a/__for.cpp b/__for.cpp index 0c3ad33..c4d16cf 100644 --- a/__for.cpp +++ b/__for.cpp @@ -4,7 +4,7 @@ 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; bool nameDefined = variableDefined("name"); if(variableDefined("start")) { diff --git a/__for.h b/__for.h index bc7c5b7..d6efa58 100644 --- a/__for.h +++ b/__for.h @@ -9,7 +9,7 @@ namespace jet { class __for : public Tag { 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); }; diff --git a/__header.cpp b/__header.cpp index 968bc38..965e481 100644 --- a/__header.cpp +++ b/__header.cpp @@ -5,7 +5,7 @@ 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; if(!variableDefined("name")) throw coreutils::Exception("header tag must have name defined."); diff --git a/__header.h b/__header.h index 884aaf5..9756cee 100644 --- a/__header.h +++ b/__header.h @@ -11,7 +11,7 @@ namespace jet { class __header : public Tag { 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: diff --git a/__if.cpp b/__if.cpp index f729883..716c351 100644 --- a/__if.cpp +++ b/__if.cpp @@ -5,11 +5,9 @@ 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; bool booleanResult = false; - if(variableDefined("value1")) { resolveKeyword("value1"); if(variableDefined("expr")) @@ -42,7 +40,6 @@ namespace jet { processContainer(container); else if(hasContainer2) processContainer(container2); - } } diff --git a/__if.h b/__if.h index 9e0669b..362ecc9 100644 --- a/__if.h +++ b/__if.h @@ -11,7 +11,7 @@ namespace jet { class __if : public Tag { 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); }; diff --git a/__ifrow.cpp b/__ifrow.cpp index fe21df9..d31c7cc 100644 --- a/__ifrow.cpp +++ b/__ifrow.cpp @@ -7,7 +7,7 @@ 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; if(!hasContainer) throw coreutils::Exception("ifrow tag must have a container."); diff --git a/__ifrow.h b/__ifrow.h index 0c902c4..702c1e4 100644 --- a/__ifrow.h +++ b/__ifrow.h @@ -8,7 +8,7 @@ namespace jet { class __ifrow : public Tag { 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); }; diff --git a/__include.cpp b/__include.cpp index ff1ed1c..5c5f4b6 100644 --- a/__include.cpp +++ b/__include.cpp @@ -4,7 +4,7 @@ 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")) throw coreutils::Exception("file keyword must be specified."); if(hasContainer) diff --git a/__include.h b/__include.h index aa03e9d..fc368f0 100644 --- a/__include.h +++ b/__include.h @@ -8,7 +8,7 @@ namespace jet { class __include : public Tag { 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); }; diff --git a/__jet.cpp b/__jet.cpp index e2c638e..722f3f8 100644 --- a/__jet.cpp +++ b/__jet.cpp @@ -5,7 +5,7 @@ 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")) resolveKeyword("cgi"); if(variables["cgi"] == "true") { diff --git a/__jet.h b/__jet.h index ed2707b..63c8b25 100644 --- a/__jet.h +++ b/__jet.h @@ -12,7 +12,7 @@ namespace jet { class __jet : public Tag { 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); }; diff --git a/__mysql.cpp b/__mysql.cpp index ea1a1d0..a751e1d 100644 --- a/__mysql.cpp +++ b/__mysql.cpp @@ -4,7 +4,7 @@ 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")) throw coreutils::Exception("host must be specified for mysql tag."); diff --git a/__mysql.h b/__mysql.h index fbcde08..1759065 100644 --- a/__mysql.h +++ b/__mysql.h @@ -12,7 +12,7 @@ namespace jet { class __mysql : public Tag { 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(); void query(coreutils::MString query); diff --git a/__read.cpp b/__read.cpp index ad386e3..e62a3f6 100644 --- a/__read.cpp +++ b/__read.cpp @@ -6,7 +6,7 @@ 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")) throw coreutils::Exception("file keyword must be specified."); if(!variableDefined("name")) diff --git a/__read.h b/__read.h index 415fca7..4f4e286 100644 --- a/__read.h +++ b/__read.h @@ -8,7 +8,7 @@ namespace jet { class __read : public Tag { 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: int fd; diff --git a/__set.cpp b/__set.cpp index ebebad0..a23dfff 100644 --- a/__set.cpp +++ b/__set.cpp @@ -6,7 +6,7 @@ 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; if(!variableDefined("name")) throw coreutils::Exception("set tag must have name defined."); diff --git a/__set.h b/__set.h index ff03a43..1b0f88d 100644 --- a/__set.h +++ b/__set.h @@ -11,7 +11,7 @@ namespace jet { class __set : public Tag { 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: diff --git a/__sql.cpp b/__sql.cpp index 6729e98..7db6ee4 100644 --- a/__sql.cpp +++ b/__sql.cpp @@ -9,7 +9,7 @@ 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; if(!hasContainer) throw coreutils::Exception("sql tag must have a container."); diff --git a/__sql.h b/__sql.h index 0b68b36..60374d8 100644 --- a/__sql.h +++ b/__sql.h @@ -8,7 +8,7 @@ namespace jet { class __sql : public Tag { 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); }; diff --git a/__stream.cpp b/__stream.cpp index 3a8b623..7ae236d 100644 --- a/__stream.cpp +++ b/__stream.cpp @@ -3,7 +3,7 @@ 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")) throw coreutils::Exception("stream tag must have a file name to stream."); diff --git a/__stream.h b/__stream.h index 961fa90..f27e5c5 100644 --- a/__stream.h +++ b/__stream.h @@ -9,7 +9,7 @@ namespace jet { class __stream : public Tag { 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); }; diff --git a/__system.cpp b/__system.cpp index 398f95a..416b73a 100644 --- a/__system.cpp +++ b/__system.cpp @@ -8,7 +8,7 @@ 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) throw coreutils::Exception("system tag cannot have a container."); if(!variableDefined(coreutils::ZString("cmd"))) diff --git a/__system.h b/__system.h index 8027a07..06c4b1f 100644 --- a/__system.h +++ b/__system.h @@ -8,7 +8,7 @@ namespace jet { class __system : public Tag { 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: int pid; diff --git a/__tag.cpp b/__tag.cpp index f30aa91..b75fae0 100644 --- a/__tag.cpp +++ b/__tag.cpp @@ -3,7 +3,7 @@ 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; output = false; if(!variableDefined("name")) diff --git a/__tag.h b/__tag.h index 121319a..bc9d6f9 100644 --- a/__tag.h +++ b/__tag.h @@ -11,7 +11,7 @@ namespace jet { class __tag : public Tag { 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 tags; diff --git a/__until.cpp b/__until.cpp index e006837..d8c325d 100644 --- a/__until.cpp +++ b/__until.cpp @@ -5,7 +5,7 @@ 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; bool booleanResult = false; diff --git a/__until.h b/__until.h index c396d55..d7639ed 100644 --- a/__until.h +++ b/__until.h @@ -9,7 +9,7 @@ namespace jet { class __until : public Tag { 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); }; diff --git a/__while.cpp b/__while.cpp index 77c9494..ac6603f 100644 --- a/__while.cpp +++ b/__while.cpp @@ -5,7 +5,7 @@ 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; bool booleanResult = false; diff --git a/__while.h b/__while.h index f921027..13585b9 100644 --- a/__while.h +++ b/__while.h @@ -9,7 +9,7 @@ namespace jet { class __while : public Tag { 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); }; diff --git a/__whiledir.cpp b/__whiledir.cpp index f21259e..8d063f4 100644 --- a/__whiledir.cpp +++ b/__whiledir.cpp @@ -8,7 +8,7 @@ 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")) throw coreutils::Exception("whiledir tag must specify a path."); resolveKeyword("path"); diff --git a/__whiledir.h b/__whiledir.h index 00c30e7..fc7563c 100644 --- a/__whiledir.h +++ b/__whiledir.h @@ -10,7 +10,7 @@ namespace jet { class __whiledir : public Tag { 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); }; diff --git a/__whilerow.cpp b/__whilerow.cpp index 66b725e..ab84c32 100644 --- a/__whilerow.cpp +++ b/__whilerow.cpp @@ -5,7 +5,7 @@ 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(); diff --git a/__whilerow.h b/__whilerow.h index e19dad5..1b0c96b 100644 --- a/__whilerow.h +++ b/__whilerow.h @@ -10,7 +10,7 @@ namespace jet { class __whilerow : public Tag { 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); }; diff --git a/__write.cpp b/__write.cpp index d975635..4581506 100644 --- a/__write.cpp +++ b/__write.cpp @@ -7,7 +7,7 @@ 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; int mode = 0; int len; diff --git a/__write.h b/__write.h index 90a5b2d..bedb39d 100644 --- a/__write.h +++ b/__write.h @@ -11,7 +11,7 @@ namespace jet { class __write : public Tag { 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: diff --git a/jet-2.0.cpp b/jet-2.0.cpp index 8ceffe6..7ba08d8 100644 --- a/jet-2.0.cpp +++ b/jet-2.0.cpp @@ -17,7 +17,7 @@ int main(int argc, char **argv, char **envp) { try { coreutils::MString out; 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; global.outputHeaders(); std::cout << out; diff --git a/tests/dump.txt b/tests/dump.txt index c757db5..e137525 100644 --- a/tests/dump.txt +++ b/tests/dump.txt @@ -17,14 +17,15 @@ noeval=[this is the value store in #[name1].] nonexistant=[] numbers=[0123456789] subtraction=[2] -testinclude=[] theexpr=[bcd] thename=[this is the value store in localname.] tohex=[tohex] varname1=[vardata] x=[] *** LOCAL VARIABLES *** -file=[./testinclude.jet] -localvar=[This is a container set with ''] -name1=[] -testinclude=[xThis is a container set with ''x] +cgi=[true] +filterblanklines=[true] +localvar=[This is a container set with 'localname'] +name1=[localname] +testinclude=[xThis is a container set with 'localname'x] +trimlines=[true] diff --git a/tests/testinclude.jet b/tests/testinclude.jet index 2ac52ce..4724a8d 100644 --- a/tests/testinclude.jet +++ b/tests/testinclude.jet @@ -3,5 +3,5 @@ This is from an include tag. localname='#[name1]' -test='$[testinclude]' +test='#[testinclude]' \ No newline at end of file