Compare commits
2
Commits
45129fd3d1
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
962f20e56d | ||
|
|
3397609c12 |
No files matched your search
@@ -200,13 +200,25 @@ void DlangVM::Execute(ByteCodeArray bytecode)
|
||||
auto b = stack.pop();
|
||||
auto a = stack.pop();
|
||||
|
||||
if (a.type != StackValueType::Int || b.type != StackValueType::Int)
|
||||
throw std::runtime_error("LESS_THAN Operation error, not all variables are integer!");
|
||||
|
||||
if (a.type == StackValueType::Int && b.type == StackValueType::Int)
|
||||
{
|
||||
stack.push(StackValue(StackValueType::Bool,
|
||||
std::get<double>(a.data) ==
|
||||
std::get<double>(b.data)
|
||||
));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (a.type == StackValueType::String && b.type == StackValueType::String)
|
||||
{
|
||||
stack.push(StackValue(StackValueType::Bool,
|
||||
std::get<std::string>(a.data) ==
|
||||
std::get<std::string>(b.data)
|
||||
));
|
||||
continue;
|
||||
}
|
||||
|
||||
throw std::runtime_error("COMPARE Operation error, in compatible variables!");
|
||||
} break;
|
||||
|
||||
case Opcodes::GTE: {
|
||||
@@ -284,6 +296,8 @@ void DlangVM::Execute(ByteCodeArray bytecode)
|
||||
|
||||
if (a.type == StackValueType::Int && b.type == StackValueType::Int) {
|
||||
result.data = (std::get<double>(a.data) != std::get<double>(b.data));
|
||||
} else if(a.type == StackValueType::String && b.type == StackValueType::String) {
|
||||
result.data = (std::get<std::string>(a.data) != std::get<std::string>(b.data));
|
||||
}
|
||||
|
||||
stack.push(result);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
inline ModuleManager* pluginManager = nullptr;
|
||||
|
||||
#define DEBUG_MODE 0
|
||||
#define VERSION "v1.0.37"
|
||||
#define VERSION "v1.0.39"
|
||||
|
||||
using ByteCodeArray = std::vector<double>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user