Slight fix for var access
This commit is contained in:
@@ -44,6 +44,12 @@ Value execute(Instruction inst) {
|
|||||||
if (inst.instruction == InstructionType::Assert) {
|
if (inst.instruction == InstructionType::Assert) {
|
||||||
return modules::assert(inst.args);
|
return modules::assert(inst.args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For all other instructions, evaluate the arguments first
|
||||||
|
for(auto& arg : inst.args) {
|
||||||
|
arg = evaluate(arg);
|
||||||
|
}
|
||||||
|
|
||||||
if (inst.instruction == InstructionType::Variable) {
|
if (inst.instruction == InstructionType::Variable) {
|
||||||
auto& args = inst.args;
|
auto& args = inst.args;
|
||||||
|
|
||||||
@@ -235,11 +241,6 @@ Value execute(Instruction inst) {
|
|||||||
return Value();
|
return Value();
|
||||||
}
|
}
|
||||||
|
|
||||||
// For all other instructions, evaluate the arguments first
|
|
||||||
for(auto& arg : inst.args) {
|
|
||||||
arg = evaluate(arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Then, execute the instruction with the evaluated arguments
|
// Then, execute the instruction with the evaluated arguments
|
||||||
switch (inst.instruction) {
|
switch (inst.instruction) {
|
||||||
case InstructionType::Print:
|
case InstructionType::Print:
|
||||||
|
|||||||
Reference in New Issue
Block a user