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;
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tag::processContainer(coreutils::ZString &container) {
|
void Tag::processContainer(coreutils::ZString &container, coreutils::ZString container2) {
|
||||||
if(hasContainer && evaluate)
|
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;
|
coreutils::ZString tag;
|
||||||
char *start = in.getCursor();
|
char *start = in.getCursor();
|
||||||
while(!in.eod()) {
|
while(!in.eod()) {
|
||||||
@ -205,8 +205,7 @@ namespace jet {
|
|||||||
__dotag _dotag(in, out, global, this, local);
|
__dotag _dotag(in, out, global, this, local);
|
||||||
continue;
|
continue;
|
||||||
} else if(ifTagName(in, "container")) {
|
} else if(ifTagName(in, "container")) {
|
||||||
while(!containerOut.eod())
|
processContainer(container2);
|
||||||
out.write(containerOut.nextChar());
|
|
||||||
in.ifNext("<container");
|
in.ifNext("<container");
|
||||||
in.skipWhitespace();
|
in.skipWhitespace();
|
||||||
in.ifNext("/>");
|
in.ifNext("/>");
|
||||||
|
4
Tag.h
4
Tag.h
@ -30,8 +30,8 @@ namespace jet {
|
|||||||
bool hasContainer = false;
|
bool hasContainer = false;
|
||||||
bool hasContainer2 = false;
|
bool hasContainer2 = false;
|
||||||
bool keywordDefined(coreutils::ZString variable);
|
bool keywordDefined(coreutils::ZString variable);
|
||||||
void parseContainer(coreutils::ZString &in, coreutils::MString &out);
|
void parseContainer(coreutils::ZString &in, coreutils::MString &out, coreutils::ZString container2 = NULL);
|
||||||
void processContainer(coreutils::ZString &container);
|
void processContainer(coreutils::ZString &container, coreutils::ZString container2 = NULL);
|
||||||
void copyContainer(coreutils::ZString &in, coreutils::MString &out);
|
void copyContainer(coreutils::ZString &in, coreutils::MString &out);
|
||||||
|
|
||||||
coreutils::MString &parentOut;
|
coreutils::MString &parentOut;
|
||||||
|
@ -8,8 +8,7 @@ namespace jet {
|
|||||||
parseContainer(container, containerOut);
|
parseContainer(container, containerOut);
|
||||||
containerOut.reset();
|
containerOut.reset();
|
||||||
coreutils::ZString container3 = global.tags[name];
|
coreutils::ZString container3 = global.tags[name];
|
||||||
hasContainer = true;
|
processContainer(container3, container);
|
||||||
processContainer(container3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace jet {
|
|||||||
throw coreutils::Exception("tag must have a name.");
|
throw coreutils::Exception("tag must have a name.");
|
||||||
if(!hasContainer)
|
if(!hasContainer)
|
||||||
throw coreutils::Exception("tag requires a container to process.");
|
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-2.0
|
||||||
<jet filterblanklines="true" trimlines="true">
|
<jet filterblanklines="true" trimlines="true">
|
||||||
<tag name="testform">
|
<tag name="testform">
|
||||||
<tag name="testinput">
|
|
||||||
<input type="input" name="name" value="#[test]" />
|
|
||||||
</tag>
|
|
||||||
<form>
|
<form>
|
||||||
1-$[test]
|
|
||||||
<container />
|
<container />
|
||||||
2-$[test]
|
/form>
|
||||||
#[test]
|
|
||||||
</form>
|
|
||||||
</tag>
|
</tag>
|
||||||
<set name="ix" value="1" />
|
<testform>
|
||||||
<testform test="this is a var">
|
xxx
|
||||||
a
|
|
||||||
<testinput />
|
|
||||||
<set name="test" value="itsset" />
|
|
||||||
b
|
|
||||||
</testform>
|
</testform>
|
||||||
<testinput />
|
|
||||||
</jet>
|
</jet>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user