fix!(ltk_ritobin): half-open spans and balanced visitor unwinding - #188
Open
Crauzer wants to merge 5 commits into
Open
fix!(ltk_ritobin): half-open spans and balanced visitor unwinding#188Crauzer wants to merge 5 commits into
Crauzer wants to merge 5 commits into
Conversation
Crauzer
force-pushed
the
ritobin/cst-semantics
branch
from
August 24, 2026 13:31
c9a8f62 to
1af7966
Compare
alanpq
requested changes
Aug 24, 2026
alanpq
left a comment
Contributor
There was a problem hiding this comment.
Can we add a Visit::Abort that has the original no-unwind behaviour, and an Aborted outcome as well
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.
Two breaking semantic fixes to the CST layer plus two small walk features, split out so they land ahead of the Locator/Visitor API work (#176, #175) that builds on them. No file overlap with feat/ptch-resolve, which can rebase cleanly after this merges.
Span semantics
Span::containsis now half-open, matchingintersects(the ltk_ritobin: Add Locator API #176 checkbox): a boundary offset belongs to exactly one of two adjacent spans, and empty spans contain nothing. No in-crate caller relied on the inclusive end; downstream (LSP) finders should re-check boundary handling.Visitor walk semantics
Visit::Stopnow unwinds:exit_treeruns exactly once for every entered node, innermost first, wherever the Stop came from (enter_tree,visit_token, a descendant, orexit_treeitself). Previously open ancestors skipped their exits, corrupting downstream scope stacks - the bug noted in ltk_ritobin: Add Locator API #176.Visit::Skipis scoped per callback: fromenter_treeit skips the node's children, fromvisit_tokenthe node's remaining children, and fromexit_treeit prunes the parent's remaining children - the sibling-skip that used to happen by accident is now a documented semantic.Cst::walkreports how it ended:WalkOutcome::{Completed, Stopped}, so finders that Stop on success no longer need a found-it flag.ControlFlow<Unwind>, and the printer stops writing after its first error.