zsh-syntax-highlighting
zsh-syntax-highlighting copied to clipboard
Make parser reusable
The main highlighter incorporates a zsh syntax parser. Separate that parser into an independently reusable component. The lexer is mostly handled by bufferwords() aka ${(z)}, ~~although subshells and command substitutions are not currently recursed into (they're returned as a single token)~~.
I do not have a concrete use-case for that at the moment, but I suspect one of these days somebody on zsh-workers@ will have an idea that will be much easier to implement were this done.
Note: it would be nice to reuse Src/parse.c's code, or to share code with compsys (get_comp_string).
Parsing parameter expansions should probably be its own project. :-)