Structs (IN BETA)
This commit is contained in:
@@ -10,6 +10,13 @@ Value evaluate(Value val) {
|
||||
}
|
||||
} else if (val.valtype == ValueType::Variable) {
|
||||
return data::getValue(val.varName.key);
|
||||
} else if (val.valtype == ValueType::Identifier) {
|
||||
// Check if it's a variable that doesn't start with $
|
||||
for (auto it = data::scopes.rbegin(); it != data::scopes.rend(); ++it) {
|
||||
if (it->count(val.string_val)) {
|
||||
return (*it)[val.string_val];
|
||||
}
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user