Commit 1adc9e7d authored by jm15g21's avatar jm15g21
Browse files

Update OperationClear.java

parent fd344426
......@@ -34,6 +34,8 @@ public class OperationClear implements IOperation {
@Override
public void operate(Instruction instruction, Interpreter master) {
//Remove the variable from the variable store, if it exists.
master.getVariableStore().remove(instruction.getArguments()[0]);
//Clear doesn't delete the variable, but sets it to 0.
//master.removeVariable(instruction.getArguments()[0]);
master.modifyVariable(instruction.getArguments()[0], 0);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment