gsb property Null safety

NormalArgOperation gsb
final

Implementation

static final NormalArgOperation gsb = RunProgramOperation(
    runner: () => GosubProgramRunner(),
    arg: LabelArg(
        maxDigit: 15,
        indirect: true,
        f: (m, final int? label) {
          // indirect: set true, because GSB (i) was implemented in the first
          // released versions of JRPN.  I'm pretty sure this isn't implemented
          // in the real 16C.  For stricter simulation, we could disallow it
          // and make the corresponding opcode illegal.
          if (label == null) {
            // Like, I is a float outside int range
            throw CalculatorError(4);
          }
          m.memory.program.gosub(label);
        }),
    name: 'GSB');