Fixed for tag.

This commit is contained in:
brad Arant committed 2024-07-08 18:32:56 -07:00
1 parent d10ed783fa
commit dd5768ea66
20 files changed
+199 -78

No files matched your search

+9 -8
View File
@@ -1,3 +1,4 @@
#include "__if.h"
#include "Exception.h"
#include <iostream>
@@ -5,7 +6,7 @@
namespace jet {
__if::__if(coreutils::ZString &in, coreutils::MString &out, Global &global) : Tag(in, out, global) {
__if::__if(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global, "else") {
coreutils::MString result;
@@ -14,7 +15,7 @@ namespace jet {
throw coreutils::Exception("Either value1 or expr can be specified but not both.");
if(variableDefined("value2")) {
if(variableDefined("type")) {
result = "true";
} else
throw coreutils::Exception("type expected if value1 and value2 specified.");
} else
@@ -25,13 +26,13 @@ namespace jet {
if(variableDefined("type"))
throw coreutils::Exception("type should not be specified with expr.");
result = Expression(variables["expr"]);
std::cout << "result1: " << result << std::endl;
}
std::cout << "result2: " << result << std::endl;
if(result.boolValue()) {
parseContainer(container);
}
if(result.boolValue())
processContainer(container);
else
if(hasContainer2)
processContainer(container2);
}
}