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

Re: PATCH: doshfunc



On Jul 10, 11:42am, Sven Wischnowsky wrote:
} Subject: Re: PATCH: doshfunc
}
} Bart Schaefer wrote:
} 
} > 	foo () {
} > 		bar () {
} > 			print oops
} > 		}
} > 		foo "$@"
} > 	}
} > 
} > Something has magically supplied the `foo "$@"' at the end of the file!
} 
} It's eval_autoload() -- which you wrote this way in 8404 ;-)

No, it's not eval_autoload():

2122        if (!(shf->flags & PM_UNDEFINED))
(gdb) n
2125        if (shf->funcdef) {
(gdb) 
2126            freeeprog(shf->funcdef);
(gdb) 
2127            shf->funcdef = &dummy_eprog;
(gdb) 
2129        if (ops['X'] == 1) {
(gdb) 
2138        return !loadautofn(shf, (ops['k'] ? 2 : (ops['z'] ? 0 : 1)), 1);

The code that does `name "$@"' in eval_autoload() is assembling a command
to pass to bin_eval().  It doesn't append anything to the function def'n.

} > ...
} > 
} > So I still can't reach the `goto doneshfunc'.
} 
} You were asking about EF_RUN, that's what I tried to explain.

Right, I asked about EF_RUN because that error message is inside an
`if (prog->flags & EF_RUN)'.

} If you want that error message:
} 
}   % echo 'bar() { echo foobar }' >foo
}   % zcompile -k foo
}   % fpath=(. $fpath)
}   % autoload foo
}   % foo
}   zsh: foo: function not defined by file

That error message came from line 3253, not line 3381.

} or:
} 
}   % rm -f foo.zwc
}   % echo 'bar() { echo foobar }' >foo
}   % setopt kshautoload
}   % fpath=(. $fpath)
}   % autoload foo
}   % foo
}   zsh: foo: function not defined by file

Same thing there; the error is from line 3253.

Once again, what I want to know is how you reach line 3372 with EF_RUN in
the Eprog flags, and hence get the error from line 3381.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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