init method Null safety

  1. @override
void init(
  1. int registerBase,
  2. {required OpInitFunction f,
  3. required ProgramOperation? shift,
  4. required bool argDot,
  5. required ProgramOperation? arg,
  6. required bool userMode}
)
override

Implementation

@override
void init(int registerBase,
    {required OpInitFunction f,
    required ProgramOperation? shift,
    required bool argDot,
    required ProgramOperation? arg,
    required bool userMode}) {
  if (arg != null) {
    // Move arg over to shift, e.g. for STO MATRIX A
    assert(shift == null);
    shift = arg;
    arg = null;
  }
  assert(!argDot);
  final nextKey = keys.iterator;
  _next = List.generate(keys.length, (i) {
    nextKey.moveNext();
    final Arg a = generator(i);
    a.init(registerBase,
        f: f,
        shift: shift,
        argDot: argDot,
        arg: nextKey.current,
        userMode: userMode);
    return a;
  });
}