RegisterWriteArg constructor Null safety

RegisterWriteArg(
  1. {required int maxDigit,
  2. required Value f(
    1. Model<ProgramOperation> m
    ),
  3. bool noParenI = false}
)

Implementation

RegisterWriteArg(
    {required int maxDigit, required this.f, bool noParenI = false})
    : super(synonyms: Arg.registerISynonyms, children: [
        DigitArg(max: maxDigit, calc: (m, i) => m.memory.registers[i] = f(m)),
        ...(noParenI
            ? const []
            : [
                KeyArg(
                    key: Arg.kParenI,
                    child: ArgDone(
                        (m) => m.memory.registers.indirectIndex = f(m))),
              ]),
        KeyArg(
            key: Arg.kI,
            child: ArgDone((m) => m.memory.registers.index = f(m))),
      ]);