Skip to content

glob: introduce Compiler with added Globstar option - #82

Merged
gobwas merged 1 commit into
masterfrom
feature/globstar
Oct 26, 2026
Merged

gobwas merged 1 commit into
masterfrom
feature/globstar

Conversation

@gobwas

@gobwas gobwas commented Oct 26, 2026

Copy link
Copy Markdown
Owner
glob: introduce Compiler with added Globstar option

Compiler holds the compilation options; Compile(pattern, seps...) is
sugar for Compiler{Separators: seps}.Compile(pattern).

With Globstar, a `**` that is a whole segment and is followed by a
separator matches zero or more segments: `**/x` matches `x`, `a/**/b`
matches `a/b`. It is a parse-time rewrite into the `{**/,}` idiom, so
the matching engine is unchanged. The fuzz oracle learns the same rule,
and the fuzzer now takes arbitrary separators.

Closes #76. See also #58, #65.

Compiler holds the compilation options; Compile(pattern, seps...) is
sugar for Compiler{Separators: seps}.Compile(pattern).

With Globstar, a `**` that is a whole segment and is followed by a
separator matches zero or more segments: `**/x` matches `x`, `a/**/b`
matches `a/b`. It is a parse-time rewrite into the `{**/,}` idiom, so
the matching engine is unchanged. The fuzz oracle learns the same rule,
and the fuzzer now takes arbitrary separators.

Closes #76. See also #58, #65.
@gobwas
gobwas merged commit ff0540d into master Oct 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant