From ad48c530a017fe65a9a599448b9ce9452bd11da7 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Wed, 30 Oct 2024 15:23:13 -0700 Subject: [PATCH] Added parent tag pointer throughout call hierarchy.Cleaned up output hierarchy parameter names. --- Tag.cpp | 55 +++++++++++++++++++++++++------------------------- Tag.h | 5 +++-- __call.cpp | 2 +- __call.h | 2 +- __comment.cpp | 2 +- __comment.h | 2 +- __dotag.cpp | 2 +- __dotag.h | 2 +- __for.cpp | 2 +- __for.h | 2 +- __header.cpp | 2 +- __header.h | 2 +- __if.cpp | 2 +- __if.h | 2 +- __ifrow.cpp | 2 +- __ifrow.h | 2 +- __include.cpp | 2 +- __include.h | 2 +- __jet.cpp | 2 +- __jet.h | 2 +- __mysql.cpp | 2 +- __mysql.h | 2 +- __read.cpp | 2 +- __read.h | 2 +- __set.cpp | 2 +- __set.h | 2 +- __sql.cpp | 2 +- __sql.h | 2 +- __stream.cpp | 2 +- __stream.h | 2 +- __system.cpp | 2 +- __system.h | 2 +- __tag.cpp | 2 +- __tag.h | 2 +- __while.cpp | 2 +- __while.h | 2 +- __whiledir.cpp | 2 +- __whiledir.h | 2 +- __whilerow.cpp | 2 +- __whilerow.h | 2 +- __write.cpp | 2 +- __write.h | 2 +- jet-2.0.cpp | 4 ++-- testdb.jet | 9 +++++++++ testfor.jet | 6 ++++++ testjet.jet | 6 ------ 46 files changed, 87 insertions(+), 78 deletions(-) create mode 100755 testdb.jet create mode 100755 testfor.jet diff --git a/Tag.cpp b/Tag.cpp index d791158..1e89d63 100644 --- a/Tag.cpp +++ b/Tag.cpp @@ -27,11 +27,11 @@ namespace jet { - Tag::Tag(coreutils::ZString &in, coreutils::MString &parent, Global &global, coreutils::ZString splitTagName) - : ZString(in), parent(parent), global(global) { + Tag::Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName) + : ZString(in), parentOut(parentOut), global(global), parent(parent) { this->splitTagName = splitTagName; if(in.ifNext("<")) { - name = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!"); + name = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!"); if(in.startsWith(" ") || in.startsWith("/") || in.startsWith(">")) { coreutils::Log(coreutils::LOG_DEBUG_1) << "Processing tag: " << name; bool finished = false; @@ -100,11 +100,10 @@ namespace jet { Tag::~Tag() { if(evaluate) - if(output) - copyContainer(out, parent); - else - if(output) - copyContainer(container, parent); + if(output) + copyContainer(out, parentOut); + else if(output) + copyContainer(container, parentOut); } void Tag::processContainer(coreutils::ZString &container, coreutils::ZString container2) { @@ -118,64 +117,64 @@ namespace jet { while(!in.eod()) { if(in.startsWith("<")) { if(ifTagName(in, "mysql")) { - __mysql _mysql(in, out, global); + __mysql _mysql(in, out, global, this); continue; } else if(ifTagName(in, "comment")) { - __comment _comment(in, out, global); + __comment _comment(in, out, global, this); continue; } else if(ifTagName(in, "sql")) { - __sql _sql(in, out, global); + __sql _sql(in, out, global, this); continue; } else if(ifTagName(in, "whilerow")) { - __whilerow _whilerow(in, out, global); + __whilerow _whilerow(in, out, global, this); continue; } else if(ifTagName(in, "for")) { - __for _for(in, out, global); + __for _for(in, out, global, this); continue; } else if(ifTagName(in, "if")) { - __if _if(in, out, global); + __if _if(in, out, global, this); continue; } else if(ifTagName(in, "ifrow")) { - __ifrow _ifrow(in, out, global); + __ifrow _ifrow(in, out, global, this); continue; } else if(ifTagName(in, "include")) { - __include _include(in, out, global); + __include _include(in, out, global, this); continue; } else if(ifTagName(in, "jet")) { - __jet _jet(in, out, global); + __jet _jet(in, out, global, this); continue; } else if(ifTagName(in, "read")) { - __read _read(in, out, global); + __read _read(in, out, global, this); continue; } else if(ifTagName(in, "write")) { - __write _write(in, out, global); + __write _write(in, out, global, this); continue; } else if(ifTagName(in, "set")) { - __set _set(in, out, global); + __set _set(in, out, global, this); continue; } else if(ifTagName(in, "call")) { - __call _call(in, out, global); + __call _call(in, out, global, this); continue; } else if(ifTagName(in, "system")) { - __system _system(in, out, global); + __system _system(in, out, global, this); continue; } else if(ifTagName(in, "while")) { - __while _while(in, out, global); + __while _while(in, out, global, this); continue; } else if(ifTagName(in, "header")) { - __header _header(in, out, global); + __header _header(in, out, global, this); continue; } else if(ifTagName(in, "whiledir")) { - __whiledir _whiledir(in, out, global); + __whiledir _whiledir(in, out, global, this); continue; } else if(ifTagName(in, "stream")) { - __stream _stream(in, out, global); + __stream _stream(in, out, global, this); continue; } else if(ifTagName(in, "tag")) { - __tag _tag(in, out, global); + __tag _tag(in, out, global, this); continue; } else if(ifTagDefined(in, tag)) { - __dotag _dotag(in, out, global); + __dotag _dotag(in, out, global, this); continue; } else if(ifTagName(in, "container")) { processContainer(container2); diff --git a/Tag.h b/Tag.h index 4bc24cd..ab695a9 100644 --- a/Tag.h +++ b/Tag.h @@ -11,7 +11,7 @@ namespace jet { class Tag : public coreutils::ZString { public: - Tag(coreutils::ZString &in, coreutils::MString &parent, Global &global, coreutils::ZString splitTagName = ""); + Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName = ""); virtual ~Tag(); coreutils::ZString name; coreutils::ZString container; @@ -27,8 +27,9 @@ namespace jet { void copyContainer(coreutils::ZString &in, coreutils::MString &out); Global &global; - coreutils::MString &parent; + Tag *parent; + coreutils::MString &parentOut; coreutils::MString out; bool output = true; diff --git a/__call.cpp b/__call.cpp index 1bd2c2b..9ce2f60 100644 --- a/__call.cpp +++ b/__call.cpp @@ -9,7 +9,7 @@ namespace jet { - __call::__call(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { + __call::__call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(hasContainer) throw coreutils::Exception("call tag cannot have a container."); if(!variableDefined("pgm")) diff --git a/__call.h b/__call.h index 09beb14..6cd0edb 100644 --- a/__call.h +++ b/__call.h @@ -8,7 +8,7 @@ namespace jet { class __call : public Tag { public: - __call(coreutils::ZString &in, coreutils::MString &out, Global &global); + __call(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); private: int pid; diff --git a/__comment.cpp b/__comment.cpp index 6aad00c..8a6d461 100644 --- a/__comment.cpp +++ b/__comment.cpp @@ -3,7 +3,7 @@ namespace jet { - __comment::__comment(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { + __comment::__comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(!hasContainer) throw coreutils::Exception("comment must have a container."); output = false; diff --git a/__comment.h b/__comment.h index 2fe6a49..52a2f78 100644 --- a/__comment.h +++ b/__comment.h @@ -8,7 +8,7 @@ namespace jet { class __comment : public Tag { public: - __comment(coreutils::ZString &in, coreutils::MString &out, Global &global); + __comment(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__dotag.cpp b/__dotag.cpp index b7e8258..909fd13 100644 --- a/__dotag.cpp +++ b/__dotag.cpp @@ -3,7 +3,7 @@ namespace jet { - __dotag::__dotag(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __dotag::__dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { hasContainer = true; coreutils::ZString container3 = global.tags[name]; processContainer(container3, container); diff --git a/__dotag.h b/__dotag.h index 44b9754..42b3b12 100644 --- a/__dotag.h +++ b/__dotag.h @@ -9,7 +9,7 @@ namespace jet { class __dotag : public Tag { public: - __dotag(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __dotag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__for.cpp b/__for.cpp index 940d018..659ec5c 100644 --- a/__for.cpp +++ b/__for.cpp @@ -4,7 +4,7 @@ namespace jet { - __for::__for(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { + __for::__for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { double counter = 0.0f; double end = 0.0f; double step = 0.0f; diff --git a/__for.h b/__for.h index b20d6a1..bc7c5b7 100644 --- a/__for.h +++ b/__for.h @@ -9,7 +9,7 @@ namespace jet { class __for : public Tag { public: - __for(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __for(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__header.cpp b/__header.cpp index a6463b2..380c24f 100644 --- a/__header.cpp +++ b/__header.cpp @@ -5,7 +5,7 @@ namespace jet { - __header::__header(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __header::__header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { output = false; if(!variableDefined("name")) throw coreutils::Exception("header tag must have name defined."); diff --git a/__header.h b/__header.h index 8a67180..884aaf5 100644 --- a/__header.h +++ b/__header.h @@ -11,7 +11,7 @@ namespace jet { class __header : public Tag { public: - __header(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __header(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); protected: diff --git a/__if.cpp b/__if.cpp index ba3fa64..fa5cb5c 100644 --- a/__if.cpp +++ b/__if.cpp @@ -5,7 +5,7 @@ namespace jet { - __if::__if(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global, "else") { + __if::__if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, "else") { coreutils::MString result; bool booleanResult = false; diff --git a/__if.h b/__if.h index 6d5bec0..9e0669b 100644 --- a/__if.h +++ b/__if.h @@ -11,7 +11,7 @@ namespace jet { class __if : public Tag { public: - __if(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __if(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__ifrow.cpp b/__ifrow.cpp index 3e66628..fbba523 100644 --- a/__ifrow.cpp +++ b/__ifrow.cpp @@ -7,7 +7,7 @@ namespace jet { - __ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global, "else") { + __ifrow::__ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent, "else") { output = false; if(!hasContainer) throw coreutils::Exception("ifrow tag must have a container."); diff --git a/__ifrow.h b/__ifrow.h index c89027c..0c902c4 100644 --- a/__ifrow.h +++ b/__ifrow.h @@ -8,7 +8,7 @@ namespace jet { class __ifrow : public Tag { public: - __ifrow(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __ifrow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__include.cpp b/__include.cpp index b1c0483..cd21d3c 100644 --- a/__include.cpp +++ b/__include.cpp @@ -4,7 +4,7 @@ namespace jet { - __include::__include(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { + __include::__include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(!variableDefined("file")) throw coreutils::Exception("file keyword must be specified."); if(hasContainer) diff --git a/__include.h b/__include.h index 63363b8..aa03e9d 100644 --- a/__include.h +++ b/__include.h @@ -8,7 +8,7 @@ namespace jet { class __include : public Tag { public: - __include(coreutils::ZString &in, coreutils::MString &out, Global &global); + __include(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__jet.cpp b/__jet.cpp index 0139bcd..79c7947 100644 --- a/__jet.cpp +++ b/__jet.cpp @@ -4,7 +4,7 @@ namespace jet { - __jet::__jet(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __jet::__jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(variables["cgi"] == "true") { coreutils::ZString requestMethod(getenv("REQUEST_METHOD")); if(requestMethod == "POST") { diff --git a/__jet.h b/__jet.h index b277cf0..5497285 100644 --- a/__jet.h +++ b/__jet.h @@ -10,7 +10,7 @@ namespace jet { class __jet : public Tag { public: - __jet(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __jet(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__mysql.cpp b/__mysql.cpp index ab94b86..445bbc5 100644 --- a/__mysql.cpp +++ b/__mysql.cpp @@ -4,7 +4,7 @@ namespace jet { - __mysql::__mysql(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __mysql::__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(!variableDefined("host")) throw coreutils::Exception("host must be specified for mysql tag."); diff --git a/__mysql.h b/__mysql.h index d59689f..fbcde08 100644 --- a/__mysql.h +++ b/__mysql.h @@ -12,7 +12,7 @@ namespace jet { class __mysql : public Tag { public: - __mysql(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); ~__mysql(); void query(coreutils::MString query); diff --git a/__read.cpp b/__read.cpp index 4eb37f7..359fe2f 100644 --- a/__read.cpp +++ b/__read.cpp @@ -6,7 +6,7 @@ namespace jet { - __read::__read(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __read::__read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(!variableDefined("file")) throw coreutils::Exception("file keyword must be specified."); if(!variableDefined("name")) diff --git a/__read.h b/__read.h index 7c026b8..415fca7 100644 --- a/__read.h +++ b/__read.h @@ -8,7 +8,7 @@ namespace jet { class __read : public Tag { public: - __read(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __read(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); private: int fd; diff --git a/__set.cpp b/__set.cpp index ddccb6f..dbcdd15 100644 --- a/__set.cpp +++ b/__set.cpp @@ -5,7 +5,7 @@ namespace jet { - __set::__set(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __set::__set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { output = false; if(!variableDefined("name")) throw coreutils::Exception("set tag must have name defined."); diff --git a/__set.h b/__set.h index 7f6e78a..ff03a43 100644 --- a/__set.h +++ b/__set.h @@ -11,7 +11,7 @@ namespace jet { class __set : public Tag { public: - __set(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __set(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); protected: diff --git a/__sql.cpp b/__sql.cpp index 296af54..d4e72e8 100644 --- a/__sql.cpp +++ b/__sql.cpp @@ -9,7 +9,7 @@ namespace jet { - __sql::__sql(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __sql::__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { output = false; if(!hasContainer) throw coreutils::Exception("sql tag must have a container."); diff --git a/__sql.h b/__sql.h index 5873513..0b68b36 100644 --- a/__sql.h +++ b/__sql.h @@ -8,7 +8,7 @@ namespace jet { class __sql : public Tag { public: - __sql(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__stream.cpp b/__stream.cpp index 69ec923..9bd45e9 100644 --- a/__stream.cpp +++ b/__stream.cpp @@ -3,7 +3,7 @@ namespace jet { - __stream::__stream(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __stream::__stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(!variableDefined("name")) throw coreutils::Exception("stream tag must have a file name to stream."); diff --git a/__stream.h b/__stream.h index afe292f..961fa90 100644 --- a/__stream.h +++ b/__stream.h @@ -9,7 +9,7 @@ namespace jet { class __stream : public Tag { public: - __stream(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __stream(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__system.cpp b/__system.cpp index 9190cd6..626d2e6 100644 --- a/__system.cpp +++ b/__system.cpp @@ -8,7 +8,7 @@ namespace jet { - __system::__system(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { + __system::__system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(hasContainer) throw coreutils::Exception("system tag cannot have a container."); if(!variableDefined(coreutils::ZString("pgm"))) diff --git a/__system.h b/__system.h index bea3b18..8027a07 100644 --- a/__system.h +++ b/__system.h @@ -8,7 +8,7 @@ namespace jet { class __system : public Tag { public: - __system(coreutils::ZString &in, coreutils::MString &out, Global &global); + __system(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); private: int pid; diff --git a/__tag.cpp b/__tag.cpp index 243698f..0f11183 100644 --- a/__tag.cpp +++ b/__tag.cpp @@ -3,7 +3,7 @@ namespace jet { - __tag::__tag(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __tag::__tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { evaluate = false; output = false; if(!variableDefined("name")) diff --git a/__tag.h b/__tag.h index ed3f8c6..367b4e6 100644 --- a/__tag.h +++ b/__tag.h @@ -9,7 +9,7 @@ namespace jet { class __tag : public Tag { public: - __tag(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__while.cpp b/__while.cpp index cb3ce71..fbf7b37 100644 --- a/__while.cpp +++ b/__while.cpp @@ -4,7 +4,7 @@ namespace jet { - __while::__while(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) { + __while::__while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(variableDefined(coreutils::ZString("value1"))) { if(variableDefined(coreutils::ZString("expr"))) diff --git a/__while.h b/__while.h index 7c3d643..f921027 100644 --- a/__while.h +++ b/__while.h @@ -9,7 +9,7 @@ namespace jet { class __while : public Tag { public: - __while(coreutils::ZString &in, coreutils::MString &out, Global &global); + __while(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__whiledir.cpp b/__whiledir.cpp index bba6cd4..0f4cc3d 100644 --- a/__whiledir.cpp +++ b/__whiledir.cpp @@ -8,7 +8,7 @@ namespace jet { - __whiledir::__whiledir(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __whiledir::__whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { if(!variableDefined("path")) throw coreutils::Exception("whiledir tag must specify a path."); if(variableDefined("sort") && (variables["sort"] == "true")) { diff --git a/__whiledir.h b/__whiledir.h index cccf50a..00c30e7 100644 --- a/__whiledir.h +++ b/__whiledir.h @@ -10,7 +10,7 @@ namespace jet { class __whiledir : public Tag { public: - __whiledir(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __whiledir(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__whilerow.cpp b/__whilerow.cpp index 251cb74..66b725e 100644 --- a/__whilerow.cpp +++ b/__whilerow.cpp @@ -5,7 +5,7 @@ namespace jet { - __whilerow::__whilerow(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __whilerow::__whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { int count = variables["count"].asInteger(); diff --git a/__whilerow.h b/__whilerow.h index a56cb67..e19dad5 100644 --- a/__whilerow.h +++ b/__whilerow.h @@ -10,7 +10,7 @@ namespace jet { class __whilerow : public Tag { public: - __whilerow(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __whilerow(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); }; diff --git a/__write.cpp b/__write.cpp index 6bf327a..4c894e0 100644 --- a/__write.cpp +++ b/__write.cpp @@ -7,7 +7,7 @@ namespace jet { - __write::__write(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) { + __write::__write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent) : Tag(in, parentOut, global, parent) { output = false; int mode = 0; int len; diff --git a/__write.h b/__write.h index 7583ddf..90a5b2d 100644 --- a/__write.h +++ b/__write.h @@ -11,7 +11,7 @@ namespace jet { class __write : public Tag { public: - __write(coreutils::ZString &in, coreutils::MString &parent, Global &global); + __write(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent); protected: diff --git a/jet-2.0.cpp b/jet-2.0.cpp index 319ff35..2b14ce5 100644 --- a/jet-2.0.cpp +++ b/jet-2.0.cpp @@ -15,8 +15,8 @@ int main(int argc, char **argv) { jet::Global global; try { - coreutils::MString out; - jet::__jet *jet = new jet::__jet(data, out, global); + coreutils::MString out; + jet::__jet *jet = new jet::__jet(data, out, global, NULL); delete jet; global.outputHeaders(); std::cout << out; diff --git a/testdb.jet b/testdb.jet new file mode 100755 index 0000000..ccfa8bf --- /dev/null +++ b/testdb.jet @@ -0,0 +1,9 @@ +#!./jet-2.0 + + + select * from testdata + + $[1.id] $[1.text] $[1.value] + + + diff --git a/testfor.jet b/testfor.jet new file mode 100755 index 0000000..d075685 --- /dev/null +++ b/testfor.jet @@ -0,0 +1,6 @@ +#!./jet-2.0 + + + -->#[ix]<-- + + diff --git a/testjet.jet b/testjet.jet index 61e1425..04e5089 100755 --- a/testjet.jet +++ b/testjet.jet @@ -11,12 +11,6 @@ --- $[nonexistant] $[%HOME] - - select * from testdata - - $[1.id] $[1.text] $[1.value] - -