Repository navigation
Match a literal ] straight after a glob class [patch] - #177
Open
matt-edmondson wants to merge 2 commits into
Open
matt-edmondson wants to merge 2 commits into
matt-edmondson wants to merge 2 commits into
Conversation
DotNet.Glob read a "]" that directly follows a closed bracket class as another member of that class, so "*[[][0-9]]" matched "items[3" and not "items[3]", and the excluded form let through what it was written to hide. ExpandGlobClasses now writes each such "]" as the one-member class "[]]", which DotNet.Glob reads as the literal the pattern means. Fixes #172 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5LUHQ94WSDTYRpSJV
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5LUHQ94WSDTYRpSJV
|
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.



DotNet.Glob reads a
]that directly follows a closed bracket class as another member of that class. So*[[][0-9]]matcheditems[3but notitems[3], and the excluded form-*[[][0-9]]kept the item it was meant to hide.ExpandGlobClassesalready closes the class at the right]. It now also writes each]that comes straight after a class as the one-member class[]], and DotNet.Glob reads that as a literal]. Patterns with something else between the class and the](*[[]DEBUG]*) are unchanged.Tests
GlobClassFollowedByALiteralBracketMatchesTheBracketcovers every row of the issue's table, plus[a]]]and the unaffected*[[]DEBUG]*shape, under both case sensitivities.FilterWithAClassFollowedByALiteralBracketKeepsAndExcludesTheRightItemscovers theFiltercase and the excluded-token case.ExpandGlobClassesWritesALiteralBracketAfterAClassAsItsOwnClasspins the rewrite.DEBUGcontrol row fail. With it, the full suite passes (224/224).Overlap: open PRs #165 (unclosed
[) and #158 (^negation) edit the same area. The source change doesn't touch their lines, and the tests sit apart from the lines theirs add. Checked locally: this branch merges cleanly with every other open branch in the repo.Fixes #172
🤖 Generated with Claude Code
https://claude.ai/code/session_017vfJW5LUHQ94WSDTYRpSJV