Refactoring datatypes start (unstable)
This commit is contained in:
15
src/utils/evaluate/evaluate.cpp
Normal file
15
src/utils/evaluate/evaluate.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "evaluate.h"
|
||||
#include "../../defs/defs.h"
|
||||
#include "../../executor/executor.h"
|
||||
#include "../../data/data.h"
|
||||
|
||||
Value evaluate(Value val) {
|
||||
if (val.valtype == ValueType::Processed) {
|
||||
if (val.processed) {
|
||||
return execute(*val.processed);
|
||||
}
|
||||
} else if (val.valtype == ValueType::Variable) {
|
||||
return data::getValue(val.varName.key);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
Reference in New Issue
Block a user