This commit is contained in:
Talia-12 2023-06-01 17:46:05 +10:00
parent d7b2946f55
commit be38658478

View file

@ -26,7 +26,7 @@ data class OperationAction(val pattern: HexPattern) : Action {
return try {
val ret: Iterable<Iota> = HexArithmetics.getEngine().run(pattern, stack, startingLength)
ret.forEach(Consumer { e: Iota -> stack.add(e) })
val image2 = image.copy(stack = stack, opsConsumed = image.opsConsumed + 1)
val image2 = image.copy(stack = stack, opsConsumed = image.opsConsumed + 1) // TODO: maybe let operators figure out how many ops to consume?
OperationResult(image2, listOf(), continuation, HexEvalSounds.NORMAL_EXECUTE)
} catch (e: NoOperatorCandidatesException) {
throw MishapInvalidOperatorArgs(e.args, e.pattern)