Repository navigation
Match a path separator inside a glob class range that spans it [patch] - #164
Merged
Merged
Conversation
Path separators are masked to a private-use character before DotNet.Glob sees the pattern or the text, so a letter range left for it to match natively, such as [A-z], never contained the masked \. A range that spans / or \ is now expanded into a character list, whose separator gets masked like any literal one. Fixes #157 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3mFzENKeSfQzbkD8e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3mFzENKeSfQzbkD8e
|
matt-edmondson
added a commit
that referenced
this pull request
Oct 31, 2026
Resolve the IsNativeGlobRange conflict with #164: a lone range stays native only when its endpoints share a case or are both digits, and it does not span a path separator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5pNp5mLi7vkHCEABR
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.



Fixes #157
Summary
MaskPathSeparatorsswaps/and\for U+E000 in both the pattern and the text. A class range covers a separator only through its endpoints, so masking never reaches it, and a native range like[A-z]never contained the masked\in the text. The negated[!A-z]therefore selected the very characters it was meant to exclude.Since #156,
ResolveGlobalready runsExpandGlobClassesbefore masking. Mixed classes such as[.-0](.and0are not both letters or both digits) were already expanded into a list, and its/gets masked, so those rows of the issue's table already pass onmain. The rows still failing were the single letter range thatIsNativeGlobRangehands to DotNet.Glob unchanged,[A-z]/[!A-z].IsNativeGlobRangenow refuses a range that spans/(U+002F) or\(U+005C). Such a range goes throughToGlobCharacterList, and the separator it contains is masked like any literal one. A letter range only spans\when it runs from uppercase into lowercase, and digit ranges never span either separator, so the common[a-z],[A-Z]and[0-9]stay native.A letter range that spans
\and also covers more thanMaxGlobClassMembers(4096) characters, say[A-z], now comes back unparseable instead of matching with a missing\. That's the same limit any mixed class already has.Not in scope
/and\share one mask (#132), so a class containing one also matches the other. The new tests don't try to tell them apart, and say so.Tests
GlobClassRangeSpanningAPathSeparatorMatchesItcovers each row of the issue's table, including the negated forms, plus[*-0]and a native[a-z]control.ExpandGlobClassesRewritesOnlyClassesDotNetGlobMisreads:[!A-z]is now listed, and[A-Z]stays native.TextFilter.cschange reverted, 3 cases fail ([A-z]and[!A-z]against\, plus the expansion row). With the change, the full suite passes: 209/209 (dotnet test, net10.0, Linux).This branches from
mainindependently of #163 (#158). The two touch neighbouring helpers but different lines.Generated by Claude Code