mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-29 19:00:57 +02:00
users/19097: remove $functypetrace in favour of ref to $zsheval_context
This commit is contained in:
parent
9c29a4f1f6
commit
08e5191ff0
3 changed files with 15 additions and 52 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2014-09-18 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* users/19097: Doc/Zsh/mod_parameter.yo,
|
||||||
|
Src/Modules/parameter.c: remove functypetrace and instead add
|
||||||
|
cross-reference to zsh_eval_context.
|
||||||
|
|
||||||
2014-09-16 Marc Finet <m.dreadlock@gmail.com>
|
2014-09-16 Marc Finet <m.dreadlock@gmail.com>
|
||||||
|
|
||||||
* 33188: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
|
* 33188: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
|
||||||
|
|
|
@ -201,10 +201,7 @@ The format of each element is var(filename)tt(:)var(lineno).
|
||||||
For functions autoloaded from a file in native zsh format, where only the
|
For functions autoloaded from a file in native zsh format, where only the
|
||||||
body of the function occurs in the file, or for files that have been
|
body of the function occurs in the file, or for files that have been
|
||||||
executed by the tt(source) or `tt(.)' builtins, the trace information is
|
executed by the tt(source) or `tt(.)' builtins, the trace information is
|
||||||
shown as var(filename)tt(:)var(0), since the entire file is the
|
shown as var(filename)tt(:)var(0), since the entire file is the definition.
|
||||||
definition.
|
|
||||||
|
|
||||||
The most recent call is the first element in the array.
|
|
||||||
|
|
||||||
Most users will be interested in the information in the
|
Most users will be interested in the information in the
|
||||||
tt(funcfiletrace) array instead.
|
tt(funcfiletrace) array instead.
|
||||||
|
@ -215,6 +212,14 @@ This array contains the names of the functions, sourced files,
|
||||||
and (if tt(EVAL_LINENO) is set) tt(eval) commands. currently being
|
and (if tt(EVAL_LINENO) is set) tt(eval) commands. currently being
|
||||||
executed. The first element is the name of the function using the
|
executed. The first element is the name of the function using the
|
||||||
parameter.
|
parameter.
|
||||||
|
|
||||||
|
The standard shell array tt(zsh_eval_context) can be used to
|
||||||
|
determine the type of shell construct being executed at each depth:
|
||||||
|
note, however, that is in the opposite order, with the most recent
|
||||||
|
item last, and it is more detailed, for example including an
|
||||||
|
entry for tt(toplevel), the main shell code being executed
|
||||||
|
either interactively or from a script, which is not present
|
||||||
|
in tt($funcstack).
|
||||||
)
|
)
|
||||||
vindex(functrace)
|
vindex(functrace)
|
||||||
item(tt(functrace))(
|
item(tt(functrace))(
|
||||||
|
@ -224,13 +229,4 @@ The format of each element is var(name)tt(:)var(lineno).
|
||||||
Callers are also shown for sourced files; the caller is the point
|
Callers are also shown for sourced files; the caller is the point
|
||||||
where the tt(source) or `tt(.)' command was executed.
|
where the tt(source) or `tt(.)' command was executed.
|
||||||
)
|
)
|
||||||
vindex(functypestack)
|
|
||||||
item(tt(functypestack))(
|
|
||||||
This array corresponds element by element with tt(funcstack).
|
|
||||||
Each element contains `tt(source)' for a sourced file, `tt(function)'
|
|
||||||
for a function and `tt(eval)' for an tt(eval)'d expression. At the top
|
|
||||||
level of execution of a series of commands, tt($functypestack[1]) is
|
|
||||||
empty if the commands are being executed as a script, or one of the
|
|
||||||
previous strings if the commands are being executed as that type.
|
|
||||||
)
|
|
||||||
enditem()
|
enditem()
|
||||||
|
|
|
@ -640,41 +640,6 @@ funcfiletracegetfn(UNUSED(Param pm))
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Functions for the functypestack special parameter. */
|
|
||||||
|
|
||||||
static char **
|
|
||||||
functypestackgetfn(UNUSED(Param pm))
|
|
||||||
{
|
|
||||||
Funcstack f;
|
|
||||||
int num;
|
|
||||||
char **ret, **p;
|
|
||||||
|
|
||||||
for (f = funcstack, num = 0; f; f = f->prev, num++);
|
|
||||||
|
|
||||||
ret = (char **) zhalloc((num + 1) * sizeof(char *));
|
|
||||||
|
|
||||||
for (f = funcstack, p = ret; f; f = f->prev, p++)
|
|
||||||
{
|
|
||||||
switch (f->tp)
|
|
||||||
{
|
|
||||||
case FS_SOURCE:
|
|
||||||
*p = "source";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FS_FUNC:
|
|
||||||
*p = "function";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FS_EVAL:
|
|
||||||
*p = "eval";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*p = NULL;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Functions for the builtins special parameter. */
|
/* Functions for the builtins special parameter. */
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
|
@ -2081,8 +2046,6 @@ static const struct gsu_array funcsourcetrace_gsu =
|
||||||
{ funcsourcetracegetfn, arrsetfn, stdunsetfn };
|
{ funcsourcetracegetfn, arrsetfn, stdunsetfn };
|
||||||
static const struct gsu_array funcfiletrace_gsu =
|
static const struct gsu_array funcfiletrace_gsu =
|
||||||
{ funcfiletracegetfn, arrsetfn, stdunsetfn };
|
{ funcfiletracegetfn, arrsetfn, stdunsetfn };
|
||||||
static const struct gsu_array functypestack_gsu =
|
|
||||||
{ functypestackgetfn, arrsetfn, stdunsetfn };
|
|
||||||
static const struct gsu_array reswords_gsu =
|
static const struct gsu_array reswords_gsu =
|
||||||
{ reswordsgetfn, arrsetfn, stdunsetfn };
|
{ reswordsgetfn, arrsetfn, stdunsetfn };
|
||||||
static const struct gsu_array disreswords_gsu =
|
static const struct gsu_array disreswords_gsu =
|
||||||
|
@ -2127,8 +2090,6 @@ static struct paramdef partab[] = {
|
||||||
scanpmfunctions),
|
scanpmfunctions),
|
||||||
SPECIALPMDEF("functrace", PM_ARRAY|PM_READONLY,
|
SPECIALPMDEF("functrace", PM_ARRAY|PM_READONLY,
|
||||||
&functrace_gsu, NULL, NULL),
|
&functrace_gsu, NULL, NULL),
|
||||||
SPECIALPMDEF("functypestack", PM_ARRAY|PM_READONLY,
|
|
||||||
&functypestack_gsu, NULL, NULL),
|
|
||||||
SPECIALPMDEF("galiases", 0,
|
SPECIALPMDEF("galiases", 0,
|
||||||
&pmgaliases_gsu, getpmgalias, scanpmgaliases),
|
&pmgaliases_gsu, getpmgalias, scanpmgaliases),
|
||||||
SPECIALPMDEF("history", PM_READONLY,
|
SPECIALPMDEF("history", PM_READONLY,
|
||||||
|
|
Loading…
Reference in a new issue