haskell/cabal — pull request #1975 by hdgarrood (2014-06-28 09:02:47+00:00)
Title: Bash (globstar) style globbing

Implement bash style filename globbing for data-files (well, bash after doing `shopt -s globstar`). Subsumes #784 #1343 #1344 #1973

The plan:
* `*` can expand to a part of any file or directory but not descend into subdirectories
* `**` is the same, except that it can match any number of levels of directories (including 0).
* `{a,b,c}` can expand into `a`, `b`, or `c`, where `a`, `b`, and `c` are globs themselves. So `{foo,*bar}` expands to "foo" or "abar" or "bbar"...
* "Literal" and glob patterns may be mixed to an unlimited extent in a single directory level. That is, `foo/**/*` is allowed, and so is `foo/**/*.hs`, and `foo/**/Test*.hs`, and `foo/**/*{Test,Spec}*.hs`.
* Backslash `\` may be used to match any of the charactes `{`, `}`, `*`, `\` literally. Eg `\\` matches `\`.

Here's what I've done so far. It typechecks, but if I try to parse anything, it hangs. Any ideas?