> 3) { return Result.err(ParseError( '[SYNTAX ERROR] ${opecode.runesAsString} wrong number of operands. wants 2 or 3 operands.', start: opecode.start, end: opecode.end, lineStart: opecode.lineStart, lineNumber: opecode.lineNumber, )); } final r = operand[0]; final adr = operand[1]; final x = operand.length == 3 ? operand[2] : null; if (r.type != TokenType.gr) { Result.err(ParseError( '[SYNTAX ERROR] ${r.runesAsString} is not an expected value. value expects between GR0 and GR7.', start: r.start, end: r.end, lineStart: r.lineStart, lineNumber: r.lineNumber, )); } if (x != null) { if (x.type != TokenType.gr) { return Result.err(ParseError( '[SYNTAX ERROR] ${x.runesAsString} is not an expected value. value expects between GR1 and GR7.', start: x.start, end: x.end, lineStart: x.lineStart, lineNumber: x.lineNumber, )); } if (x.runesAsString == 'GR0') { return Result.err(ParseError( '[SYNTAX ERROR] ${x.runesAsString} is not an expected value. value expects between GR1 and GR7.', start: x.start, end: x.end, lineStart: x.lineStart, lineNumber: x.lineNumber, )); } } switch (stmt.operand) { case [final r, _] when r.isNotGr: return Err(CompileError.fromToken( '[SYNTAX ERROR] ${r.string} is not an expected value. value expects between GR0 and GR7.', r, )); case [final r, final adr]: return _compileRadrx(stmt.opecode, r, adr, gr0); case [final r, _, _] when r.isNotGr: return Err(CompileError.fromToken( '[SYNTAX ERROR] ${r.string} is not an expected value. value expects between GR0 and GR7.', r, )); case [_, _, final x] when x.isNotGr: return Err(CompileError.fromToken( '[SYNTAX ERROR] ${x.string} is not an expected value. value expects between GR1 and GR7.', x, )); case [_, _, final x] when x.string == 'GR0': return Err(CompileError.fromToken( '[SYNTAX ERROR] ${x.string} is not an expected value. value expects between GR1 and GR7.', x, )); case [final r, final adr, final x]: return _compileRadrx(stmt.opecode, r, adr, x); default: return Err(CompileError.fromToken( '[SYNTAX ERROR] ${stmt.opecode.string} wrong number of operands. wants 2 or 3 operands.', stmt.opecode, )); }