mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-01 09:41:44 +02:00
45583/0005: internal: Document the WC_FUNCDEF data layout for anonymous functions with arguments (follow-up to 29492)
This commit is contained in:
parent
338a4a299a
commit
e37df255c1
2 changed files with 12 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
|||
2020-03-22 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 45583/0005: Src/parse.c: internal: Document the WC_FUNCDEF
|
||||
data layout for anonymous functions with arguments (follow-up
|
||||
to 29492)
|
||||
|
||||
* 45583/0004: Src/parse.c, Src/zsh.h: internal: Add some comments
|
||||
around wordcodes. No functional change.
|
||||
|
||||
|
|
10
Src/parse.c
10
Src/parse.c
|
@ -175,6 +175,10 @@ struct heredocs *hdocs;
|
|||
* - followed by number of patterns for body
|
||||
* - followed by codes for body
|
||||
* - followed by strings for body
|
||||
* - if number of names is 0, followed by:
|
||||
* - the offset to the end of the funcdef
|
||||
* - the number of arguments to the function
|
||||
* - the arguments to the function
|
||||
*
|
||||
* WC_FOR
|
||||
* - data contains type (list, ...) and offset to after body
|
||||
|
@ -1734,8 +1738,9 @@ par_funcdef(int *cmplx)
|
|||
|
||||
ecbuf[p] = WCB_FUNCDEF(ecused - 1 - p);
|
||||
|
||||
/* If it's an anonymous function... */
|
||||
if (num == 0) {
|
||||
/* Unnamed function */
|
||||
/* ... look for arguments to it. */
|
||||
int parg = ecadd(0);
|
||||
ecadd(0);
|
||||
while (tok == STRING) {
|
||||
|
@ -2110,8 +2115,9 @@ par_simple(int *cmplx, int nr)
|
|||
|
||||
ecbuf[p] = WCB_FUNCDEF(ecused - 1 - p);
|
||||
|
||||
/* If it's an anonymous function... */
|
||||
if (argc == 0) {
|
||||
/* Unnamed function */
|
||||
/* ... look for arguments to it. */
|
||||
int parg = ecadd(0);
|
||||
ecadd(0);
|
||||
while (tok == STRING || IS_REDIROP(tok)) {
|
||||
|
|
Loading…
Reference in a new issue