upd: further fixing
This commit is contained in:
@ -412,14 +412,15 @@ bool Greater(std::any a, std::any b) {
|
||||
return (*ptr_a_string) > (*ptr_b_string);
|
||||
else if (((ptr_a_string != nullptr) || (ptr_b_string != nullptr))) {
|
||||
if (std::any_cast<NoneType>(&b) && *ptr_a_string != "") return true;
|
||||
// if (ptr_a_bool != nullptr) {
|
||||
// b = Any2Bool(b);
|
||||
// return int(*ptr_a_bool) > int(std::any_cast<bool>(b));
|
||||
// }
|
||||
// if (ptr_b_bool != nullptr) {
|
||||
// a = Any2Bool(a);
|
||||
// return int(std::any_cast<bool>(a)) > int(*ptr_b_bool);
|
||||
// }
|
||||
if (ptr_a_bool != nullptr) {
|
||||
b = Any2Bool(b);
|
||||
return false;
|
||||
// return int(*ptr_a_bool) > int(std::any_cast<bool>(b));
|
||||
}
|
||||
if (ptr_b_bool != nullptr) {
|
||||
a = Any2Bool(a);
|
||||
return int(std::any_cast<bool>(a)) > int(*ptr_b_bool);
|
||||
}
|
||||
return false;
|
||||
} else
|
||||
throw FatalError("Greater: Type Error", 54);
|
||||
@ -444,14 +445,15 @@ bool Less(std::any a, std::any b) {
|
||||
return (*ptr_a_string) < (*ptr_b_string);
|
||||
else if (((ptr_a_string != nullptr) || (ptr_b_string != nullptr))) {
|
||||
if (std::any_cast<NoneType>(&a) && *ptr_b_string != "") return true;
|
||||
// if (ptr_a_bool != nullptr) {
|
||||
// b = Any2Bool(b);
|
||||
// return int(*ptr_a_bool) < int(std::any_cast<bool>(b));
|
||||
// }
|
||||
// if (ptr_b_bool != nullptr) {
|
||||
// a = Any2Bool(a);
|
||||
// return int(std::any_cast<bool>(a)) < int(*ptr_b_bool);
|
||||
// }
|
||||
if (ptr_a_bool != nullptr) {
|
||||
b = Any2Bool(b);
|
||||
return int(*ptr_a_bool) < int(std::any_cast<bool>(b));
|
||||
}
|
||||
if (ptr_b_bool != nullptr) {
|
||||
a = Any2Bool(a);
|
||||
return 0;
|
||||
// return int(std::any_cast<bool>(a)) < int(*ptr_b_bool);
|
||||
}
|
||||
return false;
|
||||
} else
|
||||
throw FatalError("Less: Type Error", 55);
|
||||
@ -551,14 +553,15 @@ bool GreaterEqual(std::any a, std::any b) {
|
||||
return (*ptr_a_string) >= (*ptr_b_string);
|
||||
else if (((ptr_a_string != nullptr) || (ptr_b_string != nullptr))) {
|
||||
if (std::any_cast<NoneType>(&b)) return true;
|
||||
// if (ptr_a_bool != nullptr) {
|
||||
// b = Any2Bool(b);
|
||||
// return int(*ptr_a_bool) >= int(std::any_cast<bool>(b));
|
||||
// }
|
||||
// if (ptr_b_bool != nullptr) {
|
||||
// a = Any2Bool(a);
|
||||
// return int(std::any_cast<bool>(a)) >= int(*ptr_b_bool);
|
||||
// }
|
||||
if (ptr_a_bool != nullptr) {
|
||||
b = Any2Bool(b);
|
||||
return 0;
|
||||
// return int(*ptr_a_bool) >= int(std::any_cast<bool>(b));
|
||||
}
|
||||
if (ptr_b_bool != nullptr) {
|
||||
a = Any2Bool(a);
|
||||
return int(std::any_cast<bool>(a)) >= int(*ptr_b_bool);
|
||||
}
|
||||
return false;
|
||||
} else
|
||||
throw FatalError("GreaterEqual: Type Error", 58);
|
||||
@ -588,14 +591,15 @@ bool LessEqual(std::any a, std::any b) {
|
||||
return (*ptr_a_string) <= (*ptr_b_string);
|
||||
else if (((ptr_a_string != nullptr) || (ptr_b_string != nullptr))) {
|
||||
if (std::any_cast<NoneType>(&a)) return true;
|
||||
// if (ptr_a_bool != nullptr) {
|
||||
// b = Any2Bool(b);
|
||||
// return int(*ptr_a_bool) <= int(std::any_cast<bool>(b));
|
||||
// }
|
||||
// if (ptr_b_bool != nullptr) {
|
||||
// a = Any2Bool(a);
|
||||
// return int(std::any_cast<bool>(a)) <= int(*ptr_b_bool);
|
||||
// }
|
||||
if (ptr_a_bool != nullptr) {
|
||||
b = Any2Bool(b);
|
||||
return int(*ptr_a_bool) <= int(std::any_cast<bool>(b));
|
||||
}
|
||||
if (ptr_b_bool != nullptr) {
|
||||
a = Any2Bool(a);
|
||||
return false;
|
||||
// return int(std::any_cast<bool>(a)) <= int(*ptr_b_bool);
|
||||
}
|
||||
return false;
|
||||
} else
|
||||
throw FatalError("LessEqual: Type Error", 59);
|
||||
|
Reference in New Issue
Block a user