merge requests conflicts resolved.
This commit is contained in:
commit
93a520f152
12
Global.cpp
12
Global.cpp
@ -37,6 +37,13 @@ namespace jet {
|
||||
sessions.erase(sessionId);
|
||||
}
|
||||
|
||||
coreutils::MString& Global::processModifier(coreutils::MString &value, coreutils::MString &modifier) {
|
||||
if(modifier.getLength() == 0)
|
||||
return value;
|
||||
lastConverted = modifier;
|
||||
return lastConverted;
|
||||
}
|
||||
|
||||
coreutils::ZString Global::getVariable(coreutils::ZString &variable, std::map<coreutils::ZString, coreutils::MString> &lvariables) {
|
||||
if(variable.ifNext("$[")) {
|
||||
coreutils::MString name;
|
||||
@ -54,8 +61,9 @@ namespace jet {
|
||||
} else {
|
||||
renderVariableName(variable, name, modifier, lvariables);
|
||||
name.split(".");
|
||||
if(name.getList().size() == 1)
|
||||
return variables[name[0]];
|
||||
if(name.getList().size() == 1) {
|
||||
return processModifier(variables[name[0]], modifier);
|
||||
}
|
||||
return getSessionVariable(name);
|
||||
}
|
||||
throw coreutils::Exception("expected variable name or type designator.");
|
||||
|
2
Global.h
2
Global.h
@ -18,6 +18,7 @@ namespace jet {
|
||||
bool sessionExists(coreutils::MString sessionId);
|
||||
void addSession(coreutils::MString sessionId, __mysql *mysql);
|
||||
void removeSession(coreutils::MString sessionId);
|
||||
coreutils::MString& processModifier(coreutils::MString &value, coreutils::MString &modifier);
|
||||
coreutils::ZString getVariable(coreutils::ZString &variable, std::map<coreutils::ZString, coreutils::MString> &lvariables);
|
||||
void renderVariableName(coreutils::ZString &variable, coreutils::MString &name, coreutils::MString &modifier, std::map<coreutils::ZString, coreutils::MString> &lvariables);
|
||||
__mysql * getSession(coreutils::MString sessionId);
|
||||
@ -29,6 +30,7 @@ namespace jet {
|
||||
std::map<coreutils::MString, __mysql *> sessions;
|
||||
std::map<coreutils::MString, coreutils::MString> headers;
|
||||
std::map<coreutils::MString, coreutils::MString> tags;
|
||||
coreutils::MString lastConverted;
|
||||
|
||||
};
|
||||
|
||||
|
2
Tag.cpp
2
Tag.cpp
@ -31,7 +31,7 @@ namespace jet {
|
||||
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("<")) {
|
||||
if(parent && in.ifNext("<")) {
|
||||
name = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_!");
|
||||
if(in.startsWith(" ") || in.startsWith("/") || in.startsWith(">")) {
|
||||
bool finished = false;
|
||||
|
3
Tag.h
3
Tag.h
@ -11,7 +11,7 @@ namespace jet {
|
||||
class Tag : public coreutils::ZString {
|
||||
|
||||
public:
|
||||
Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, coreutils::ZString splitTagName = "");
|
||||
Tag(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent = NULL, coreutils::ZString splitTagName = "");
|
||||
virtual ~Tag();
|
||||
|
||||
void resolveKeyword(coreutils::ZString keyword);
|
||||
@ -41,6 +41,7 @@ namespace jet {
|
||||
bool cleanWhitespace = false;
|
||||
|
||||
private:
|
||||
bool containerOnly = false;
|
||||
coreutils::ZString splitTagName;
|
||||
|
||||
int skipBlankLine(coreutils::ZString in);
|
||||
|
@ -1,15 +1,14 @@
|
||||
#!../jet-2.0
|
||||
<set name="ix" value="1" />
|
||||
<set name="ix" value="1" />
|
||||
<set name="letterx" value="x" />
|
||||
<set name="var$[ix]" value="this is a test $[ix]" />
|
||||
<set name="1var1" value="This is another test" />
|
||||
<set name="var1var" value="Yet another test" />
|
||||
<set name="var11" value="it seems to work." />
|
||||
$[$[ix]var$[ix]]
|
||||
$[$[ix]var$[ix];binary]
|
||||
$[var$[ix]]
|
||||
$[var$[ix]var]
|
||||
$[var$[i$[letterx]]var]
|
||||
$[letterx;TOHEX]
|
||||
$[var$[i$[letterx]]$[ix]]
|
||||
$[var$[i$[letterx]]$[i$[letterx]]]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user