make yield look more like the other instructions syntactically

This commit is contained in:
Emil Gardström
2024-03-29 15:10:06 +01:00
parent f69073c1b2
commit 5dc021f953

View File

@@ -444,14 +444,13 @@ impl IC {
}
oprs => Err(ICError::mismatch_operands(oprs.len(), 1)),
}, // TODO
Yield => {
if !operands.is_empty() {
Err(ICError::too_many_operands(operands.len(), 0))
} else {
Yield => match &operands[..] {
[] => {
self.state = ICState::Yield;
Ok(())
}
}
oprs => Err(ICError::mismatch_operands(oprs.len(), 0)),
},
Define => match &operands[..] {
[name, number] => {
let &Operand::Identifier(ident) = &name else {