handleLetterLabel method Null safety
- LetterLabel operation
override
Implementation
@override
void handleLetterLabel(LetterLabel operation) {
final program = model.memory.program;
assert(controller is RealController);
// The 15C's letter labels get translated to GSB <label> when entering
// a program, so they cannot occur if we're running a program (i.e.
// when controller is RunningController). The return stack should only
// be reset when we're not currently running a program, which is the only
// case here.
program.resetReturnStack();
final gsb = controller.gsbOperation;
try {
program.gosub(operation.numericValue);
} on CalculatorError catch (e, s) {
controller.showCalculatorError(e, s);
return;
}
program.displayCurrent();
final s = RunProgramArgInputState(
gsb, gsb.arg, controller, this, () => GosubProgramRunner());
s.isDone = true;
// Since we're telling the state it's done, it won't try to do the gosub.
// It will just wait for button up, then switch to gosubDoneState, which
// will run the program.
changeState(s);
}