More work on Global getVariabke.

This commit is contained in:
Brad Arant 2024-09-23 17:07:32 -07:00
parent 0379974d5e
commit 3679644f64
2 changed files with 9 additions and 3 deletions

View File

@ -55,6 +55,11 @@ namespace jet {
coreutils::MString name = variable.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-");
if(variable.ifNext("]"))
return name;
if(variable.startsWith("$[")) {
name << getVariable(variable);
return name;
}
return coreutils::MString("");
}
}

View File

@ -41,9 +41,10 @@ int main(int argc, char **argv) {
" </html>\n"
"</jet>\n");
coreutils::ZString data("<jet>\n"
" <set name=\"test\" value=\"0123456789\" />\n"
" $[test]\n"
coreutils::ZString data("<jet filterblanklines=\"true\">\n"
" <set name=\"test1\" value=\"0123456789\" />\n"
" <set name=\"ix\" value=\"1\" />\n"
" $[test$[ix]]\n"
"</jet>\n");
// coreutils::ZString data("<jet>ABC<jet>HIJ</jet>XYZ</jet>\n");