[GlobPattern] Support brace expansions
Extend `GlobPattern` to support brace expansions, e.g., `foo.{c,cpp}` as discussed in https://reviews.llvm.org/D152762#4425203. The high level change was to turn `Tokens` into a list that gets larger when we see a new brace expansion term. Then in `GlobPattern::match()` we must check against each token group. This is a breaking change since `{` will no longer match a literal without escaping. However, `\{` will match the literal `{` before and after this change. Also, from a brief survey of LLVM, it seems that `GlobPattern` is mostly used for symbol and path matching, which likely won't need `{` in their patterns. See https://github.com/devongovett/glob-match#syntax for a nice glob reference. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D153587
Loading
Please sign in to comment