run method Null safety

  1. @override
Future<void> run()
override

Implementation

@override
Future<void> run() async {
  final program = model.program;
  bool result = await runCalculation();
  if (_subroutineStart == _subroutineNotStarted) {
    // Degenerate case:  We didn't once execute the subroutine.  Maybe
    // something like integrating from 0 to 0?
    //
    // Running the subroutine would have ended in RTN, which would have
    // popped the stack.
    program.popReturnStack();
  }
  // And, pop off the real return address
  program.popReturnStack();
  if (!program.returnStackUnderflow) {
    // If integrate/solve came inside a program
    program.doNextIf(result);
  } else if (!result) {
    fail();
  }
}