more unknown work
This commit is contained in:
parent
fce97e04ff
commit
d915714b4d
26
__if.cpp
26
__if.cpp
@ -1,30 +1,34 @@
|
||||
#include "__if.h"
|
||||
#include "Exception.h"
|
||||
#include <iostream>
|
||||
#include "Expression.h"
|
||||
|
||||
namespace jet {
|
||||
|
||||
__if::__if(coreutils::ZString &in, coreutils::MString &out) : Tag(in, out) {
|
||||
|
||||
if(keywordExists(coreutils::ZString("value1"))) {
|
||||
if(keywordExists(coreutils::ZString("expr")))
|
||||
coreutils::MString result;
|
||||
|
||||
if(keywordExists("value1")) {
|
||||
if(keywordExists("expr"))
|
||||
throw coreutils::Exception("Either value1 or expr can be specified but not both.");
|
||||
if(keywordExists(coreutils::ZString("value2"))) {
|
||||
if(keywordExists(coreutils::ZString("type"))) {
|
||||
// process here
|
||||
if(keywordExists("value2")) {
|
||||
if(keywordExists("type")) {
|
||||
|
||||
} else
|
||||
throw coreutils::Exception("type expected if value1 and value2 specified.");
|
||||
} else
|
||||
throw coreutils::Exception("value2 required if value1 specified.");
|
||||
} else if(keywordExists(coreutils::ZString("expr"))) {
|
||||
if(keywordExists(coreutils::ZString("value2")))
|
||||
} else if(keywordExists("expr")) {
|
||||
if(keywordExists("value2"))
|
||||
throw coreutils::Exception("value2 should not be specified with expr.");
|
||||
if(keywordExists(coreutils::ZString("type")))
|
||||
if(keywordExists("type"))
|
||||
throw coreutils::Exception("type should not be specified with expr.");
|
||||
// process here
|
||||
result = Expression(keywords["expr"]);
|
||||
std::cout << "result1: " << result << std::endl;
|
||||
}
|
||||
|
||||
if(true) {
|
||||
std::cout << "result2: " << result << std::endl;
|
||||
if(result.boolValue()) {
|
||||
parseContainer(container);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user