continued development

This commit is contained in:
Brad Arant committed 2024-02-16 20:16:14 -08:00
1 parent 50270bbc91
commit 3d98448ec4
6 files changed
+18 -15

No files matched your search

+5
View File
@@ -11,4 +11,9 @@ namespace jet {
}
void Global::dump() {
for (auto i = variables.begin(); i != variables.end(); i++)
std::cout << i->first << "=[" << i->second << "]" << std::endl;
}
}
+2
View File
@@ -12,6 +12,8 @@ namespace jet {
Global();
virtual ~Global();
void dump();
std::map<coreutils::MString, coreutils::MString> variables;
};
+6 -5
View File
@@ -61,11 +61,12 @@ namespace jet {
}
Tag::~Tag() {
if(evaluate) {
copyContainer(out, parent);
} else {
copyContainer(container, parent);
}
if(evaluate)
if(output)
copyContainer(out, parent);
else
if(output)
copyContainer(container, parent);
}
void Tag::parseContainer(coreutils::ZString &in) {
+2 -1
View File
@@ -18,11 +18,12 @@ namespace jet {
protected:
bool hasContainer;
std::map<coreutils::ZString, coreutils::ZString> variables;
std::map<coreutils::ZString, coreutils::MString> variables;
bool variableDefined(coreutils::ZString variable);
void parseContainer(coreutils::ZString &in);
void copyContainer(coreutils::ZString &in, coreutils::MString &out);
bool output = true;
bool evaluate = true;
bool filterBlankLines = false;
bool trim = false;
+3 -9
View File
@@ -5,20 +5,14 @@
namespace jet {
__set::__set(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
std::cout << "name: [" << variables["name"] << "]" << std::endl;
std::cout << "value: [" << variables["value"] << "]" << std::endl;
std::cout << "container: [" << container << "]" << std::endl;
std::cout << "scope: [" << variables["scope"] << "]" << std::endl;
output = false;
if(variables["scope"] == "local")
variables[variables["name"]] = variables["value"];
if(variables["scope"] == "global")
global.variables[variables["name"]] = container;
std::cout << "localvar: [" << variables.size() << "]" << std::endl;
std::cout << "localvarx: [" << variables[variables["name"]] << "]" << std::endl;
std::cout << "globalvar: [" << global.variables.size() << "]" << std::endl;
std::cout << "globalvarx: [" << global.variables[variables["name"]] << "]" << std::endl;
global.dump();
}
}
BIN
View File
Binary file not shown.