zsh-workers
 help / color / mirror / code / Atom feed
* Strange or interesting zcompile behavior, for in-loop func defs
@ 2017-07-17 13:50 Sebastian Gniazdowski
  2017-07-18  6:10 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Gniazdowski @ 2017-07-17 13:50 UTC (permalink / raw)
  To: zsh-workers

Hello,
I've added debugging message in execfuncdef():

        if (state->prog->dump || !names) {
            if (!names) {
                ...
            } else {
                fprintf( stderr, "Have dump for: %s, file: %s\n", s, state->prog->dump->filename);
                fflush( stderr );
                prog->flags = EF_MAP;
                incrdumpcount(state->prog->dump);

It outputs:

Have dump for: _zsh_highlight_widget_zle-isearch-update, file: /Users/sgniazdowski/.zplugin/lexicon.zwc

The point is: this function is declared in a loop:

         if [[ $cur_widget == zle-* ]] && [[ -z $widgets[$cur_widget] ]]; then
           _zsh_highlight_widget_${cur_widget}() { :; _zsh_highlight }

I do zcompile lexicon.zwc ~/.zplugin/lexicon/*, the directory contains function with the loop. Zcompile apparently picks up above function definition. But from where it gets ${cur_widget}? This is a dynamic data, established at runtime.

The loop:

https://github.com/zdharma/fast-syntax-highlighting/blob/07a76cd38123cac2e76aca35c0258d62b18ab490/fast-syntax-highlighting.plugin.zsh#L203-L240

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Strange or interesting zcompile behavior, for in-loop func defs
  2017-07-17 13:50 Strange or interesting zcompile behavior, for in-loop func defs Sebastian Gniazdowski
@ 2017-07-18  6:10 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2017-07-18  6:10 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: zsh-workers

On Mon, Jul 17, 2017 at 6:50 AM, Sebastian Gniazdowski
<psprint@zdharma.org> wrote:
>
> Have dump for: _zsh_highlight_widget_zle-isearch-update, file: /Users/sgniazdowski/.zplugin/lexicon.zwc

I'm fairly sure the dump structure is being found from the Eprog for
the _zsh_highlight_bind_widgets function, which contains the loop in
question, and is not actually the dump of the
_zsh_highlight_widget_zle-isearch-update function.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-18  6:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 13:50 Strange or interesting zcompile behavior, for in-loop func defs Sebastian Gniazdowski
2017-07-18  6:10 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).