reversion of tag work to ordered tag process.
This commit is contained in:
parent
779c6b0148
commit
b0e3cd85c7
9
Tag.cpp
9
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("<container");
|
||||
in.skipWhitespace();
|
||||
in.ifNext("/>");
|
||||
|
4
Tag.h
4
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;
|
||||
|
@ -8,8 +8,7 @@ namespace jet {
|
||||
parseContainer(container, containerOut);
|
||||
containerOut.reset();
|
||||
coreutils::ZString container3 = global.tags[name];
|
||||
hasContainer = true;
|
||||
processContainer(container3);
|
||||
processContainer(container3, container);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,22 +1,11 @@
|
||||
#!../jet-2.0
|
||||
<jet filterblanklines="true" trimlines="true">
|
||||
<tag name="testform">
|
||||
<tag name="testinput">
|
||||
<input type="input" name="name" value="#[test]" />
|
||||
</tag>
|
||||
<form>
|
||||
1-$[test]
|
||||
<container />
|
||||
2-$[test]
|
||||
#[test]
|
||||
</form>
|
||||
/form>
|
||||
</tag>
|
||||
<set name="ix" value="1" />
|
||||
<testform test="this is a var">
|
||||
a
|
||||
<testinput />
|
||||
<set name="test" value="itsset" />
|
||||
b
|
||||
<testform>
|
||||
xxx
|
||||
</testform>
|
||||
<testinput />
|
||||
</jet>
|
||||
|
Loading…
x
Reference in New Issue
Block a user