feat(debug): PostDebugSession.stepInstruction() (7.0.0-alpha.7, #101)#106
Merged
Conversation
Advance to the next numbered Post instruction in the current scope.
Position-independent: skips sub-step transitions inside groups
(50.1 β 50.2) and descents into called scopes (call('foo') β foo::1)
because those aren't numbered instructions in the current scope.
Two rules cover the full semantics:
1. Advance until click-time (scope, instructionIndex) pair changes;
sub-step transitions and sub-scope descents stay silent.
2. If there's no next numbered instruction in the current scope
(you hit stop or fall through the end), the natural engine
continuation fires β return to caller's continuation if inside
a call/group, halt if at top level.
Internally drives the engine via repeated stepIn; filters the
resulting step-cause pauses via path comparison. Breakpoints
mid-advance interrupt normally and consume the stepInstruction intent.
Closes #101.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
PostDebugSession.stepInstruction()β a Post-level step control that advances to the next numbered Post instruction in the current scope. Resolves #101. Post-only bump7.0.0-alpha.6β7.0.0-alpha.7.Semantics
Two rules cover the full semantics:
(scope, instructionIndex)pair changes β sub-step transitions (inside groups) and sub-scope descents (call('foo')βfoo::1) stay silent.stopor fall through the end), the natural engine continuation fires β return to caller's continuation if inside a call/group, halt if at top level.Position-independent. Same behavior whether paused at an atomic instruction, a
call(...)entry, a group entry, mid-group, or inside a called scope. Resolves the "interp A vs interp B" fork from the issue body β only the user's numbered instructions count.Implementation
(clickScope, clickInstructionIndex)from the latest pause'sarrivalPath.stepIn. On each step-cause pause, if the path is still "inside the click-time instruction" (same scope+index, sub-step transition, OR descended into a sub-scope), keep stepping silently. Otherwise surface as a normal step-cause pause.pause()mid-advance surface normally and consume the stepInstruction intent.Behavior across positions
stepInstructionoutcome10: mark(in main)20call('foo')entryfooatfoo::N(non-last)foo::N+1)fooat last numberedstopstop)Test plan
PostMachine.debugger.spec.tscovering all rows in the behavior tablenpm run check/lint/buildcleannpm publish --dry-run --workspace @post-machine-js/machine --tag nextβ tarball clean at7.0.0-alpha.7npm publish --tag nextfrompackages/machine/gh release create v7.0.0-alpha.7 --target v7 --prereleaseCompatibility
@turing-machine-js/machinewidened^7.0.0-alpha.6β^7.0.0-alpha.7. (Semver-prerelease caret already accepted alpha.7+; the widening is the workspace convention.)stepIn/stepOver/stepOut/continue/pause/stop/setRunIntervalcontrols unchanged.Issue thread
stepInstruction()) β step to next instruction index, skipping group sub-stepsΒ #101 (comment)