Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zregexparse



On Mar 29, 10:46am, Sebastian Gniazdowski wrote:
}
} I've stumbled upon zregexparse. Verified that it doesn't auto-load
} zsh/regex. Manual says:
}
}    zregexparse
}       This implements some internals of the _regex_arguments function.
} 
} Test V02 suggest this is a very capable tool. How it is compiled, with
} use of LGPL Gnu regex?

It has its own simple regular expression matcher, towards the end of
the zsh/zutil module.  There's no borrowed code, except maybe the
algorithm from a textbook.

This was invented during the time when it had been decided that there
should be separate documentation for developers and users, so the yodl
doc was deliberately sparse on things only developers were supposed to
need to know about.  Probably a poor decision in hindsight, as in many
cases the doc for developers never got written.

} I wonder what use cases might it have

It's used in the following completions:

Completion/X/Command/_xset
Completion/X/Command/_xwit
Completion/Unix/Command/_ip
Completion/Zsh/Command/_ztodo
Completion/Debian/Command/_apt

The Completion/Base/Utility/_regex_arguments file contains what little
doc there is for the syntax.

There are probably several other completions that could do better on
context-sensitive arguments than they do with _arguments, if only the
use of _regex_arguments were a bit less impenetrable.



Messages sorted by: Reverse Date, Date, Thread, Author