Skip to content

Commit 8b9304b

Browse files
committed
[ZSH] Improve bare glob qualifiers
This commit... 1. Creates separate contexts and parsing rules for a) bare glob qualifiers `(D)` Bare globs may not contain characters like `(`, `)`, `~` or `|` to prevent ambiguities with normal shell pattern matching. b) extended glob qualifiers `(#qD)` Extended globs may contain characters like `(`, `)`, `~` or `|`, as `(#` is unambiguously parsed as beginning of glob flags. Primary point of concern are glob string quotations. e.g.: `(e|expr|)` is no valid glob due to `|`, but extended form `(#qe|expr|)` is valid. Note: Lookahead patterns such as `(?![{{illegal_bare_glob_chars}}])` are used in bare qualifiers to be able to re-use same glob string contexts everywhere. Alternatively all 4 string related contexts would need to be duplicated to only include those patterns, which are valid in bare or extended glob qualifiers. 2. Adds modifiers to extended parameter expansions. `${var:s/pat/repl/:G}`
1 parent 725f267 commit 8b9304b

File tree

2 files changed

+901
-479
lines changed

2 files changed

+901
-479
lines changed

0 commit comments

Comments
 (0)