From b0e3cd85c74909041a4661372014502c946a6465 Mon Sep 17 00:00:00 2001 From: brad Arant Date: Sun, 12 Jan 2025 20:30:48 -0800 Subject: [PATCH] reversion of tag work to ordered tag process. --- Tag.cpp | 9 ++++----- Tag.h | 4 ++-- __dotag.cpp | 3 +-- __tag.cpp | 2 +- tests/testtag.jet | 17 +++-------------- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/Tag.cpp b/Tag.cpp index c0a75ae..5344eb2 100644 --- a/Tag.cpp +++ b/Tag.cpp @@ -125,12 +125,12 @@ namespace jet { return resolved; } - void Tag::processContainer(coreutils::ZString &container) { + void Tag::processContainer(coreutils::ZString &container, coreutils::ZString container2) { if(hasContainer && evaluate) - parseContainer(container, out); + parseContainer(container, out, container2); } - void Tag::parseContainer(coreutils::ZString &in, coreutils::MString &out) { + void Tag::parseContainer(coreutils::ZString &in, coreutils::MString &out, coreutils::ZString container2) { coreutils::ZString tag; char *start = in.getCursor(); while(!in.eod()) { @@ -205,8 +205,7 @@ namespace jet { __dotag _dotag(in, out, global, this, local); continue; } else if(ifTagName(in, "container")) { - while(!containerOut.eod()) - out.write(containerOut.nextChar()); + processContainer(container2); in.ifNext(""); diff --git a/Tag.h b/Tag.h index cb86fba..d63ad57 100644 --- a/Tag.h +++ b/Tag.h @@ -30,8 +30,8 @@ namespace jet { bool hasContainer = false; bool hasContainer2 = false; bool keywordDefined(coreutils::ZString variable); - void parseContainer(coreutils::ZString &in, coreutils::MString &out); - void processContainer(coreutils::ZString &container); + void parseContainer(coreutils::ZString &in, coreutils::MString &out, coreutils::ZString container2 = NULL); + void processContainer(coreutils::ZString &container, coreutils::ZString container2 = NULL); void copyContainer(coreutils::ZString &in, coreutils::MString &out); coreutils::MString &parentOut; diff --git a/__dotag.cpp b/__dotag.cpp index 55a839a..c6b596c 100644 --- a/__dotag.cpp +++ b/__dotag.cpp @@ -8,8 +8,7 @@ namespace jet { parseContainer(container, containerOut); containerOut.reset(); coreutils::ZString container3 = global.tags[name]; - hasContainer = true; - processContainer(container3); + processContainer(container3, container); } } diff --git a/__tag.cpp b/__tag.cpp index 68c66a2..5930660 100644 --- a/__tag.cpp +++ b/__tag.cpp @@ -10,7 +10,7 @@ namespace jet { throw coreutils::Exception("tag must have a name."); if(!hasContainer) throw coreutils::Exception("tag requires a container to process."); - global.tags[keywords["name"]] = container; // TODO: process container for further tag definitions. + global.tags[keywords["name"]] = container; } } diff --git a/tests/testtag.jet b/tests/testtag.jet index 222d2ba..d2d5ff3 100755 --- a/tests/testtag.jet +++ b/tests/testtag.jet @@ -1,22 +1,11 @@ #!../jet-2.0 - - -
- 1-$[test] - 2-$[test] - #[test] - + /form>
- - - a - - - b + + xxx -