zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

Make parser reusable

Open danielshahaf opened this issue 9 years ago • 1 comments

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).

danielshahaf avatar May 31 '16 07:05 danielshahaf

Parsing parameter expansions should probably be its own project. :-)

danielshahaf avatar May 31 '16 07:05 danielshahaf