Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #1736 (comment).
Testing procedure
First I tried using the debugger to step through the
1598-detect-entity-change.yaml
test added in #1736, without applying the changes of this PR.This was done by invoking it with:
then:
solution
contents to the REPL in one line:move; move; swap "dial (G)"; swap "dial (B)";
As it turns out, debugging mode for this particular scenario and solution was unbroken by #1736. A more specific test case would have to be engineered to exercise the particular gap introduced by #1736.
Since I couldn't find any existing unit/integration tests for the debugger, I have left this for a future exercise. However, based on the assumed behavior discrepancy between normal mode and debug mode, I did make a change to the
singleStep
function.Implementation notes
I had to augment the
runRobotIDs
/iterateRobots
functions to accommodate the debugger by supporting interruption of the iteration at a certainRID
and returning theRID
s that hadn't been visited yet.In
singleStep
, therunRobotIDs
function is called from within theSBefore
case, theSAfter
case, and theSSingle
case. In theSAfter
andSSingle
instance,runRobotIDs
is just used to run "the rest of the robots", so no special behavior is needed. In this PR, the behavior has been extracted to a newfinishTickWith
function.SBefore
caseThis calls
runRobotIDs preFoc
immediately. This is the only place that necessitated support for "early interruption" of the iteration ofiterateRobots
.SAfter
caseTODO
SSingle
caseTODO
Handling
stepRobot
invoked fromSSingle
TODO