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