diff options
| author | Peter Stephenson <p.stephenson@samsung.com> | 2022-06-07 10:02:14 +0100 |
|---|---|---|
| committer | Peter Stephenson <p.stephenson@samsung.com> | 2022-06-07 10:02:14 +0100 |
| commit | b26b6b3fe00b94a2d4370b1afd2644034947b6b8 (patch) | |
| tree | d29604d25defe18200cfe049d0042efd7643a865 /Src/text.c | |
| parent | 50323: create helper for shadowing builtins or existing functions and use it ... (diff) | |
| download | zsh-b26b6b3fe00b94a2d4370b1afd2644034947b6b8.tar zsh-b26b6b3fe00b94a2d4370b1afd2644034947b6b8.tar.gz zsh-b26b6b3fe00b94a2d4370b1afd2644034947b6b8.tar.bz2 zsh-b26b6b3fe00b94a2d4370b1afd2644034947b6b8.tar.lz zsh-b26b6b3fe00b94a2d4370b1afd2644034947b6b8.tar.xz zsh-b26b6b3fe00b94a2d4370b1afd2644034947b6b8.tar.zst zsh-b26b6b3fe00b94a2d4370b1afd2644034947b6b8.zip | |
Tweaks to MULTI_FUNC_DEF
Output multiple function definitions using "function" form.
Note exceptions to errors with NO_MULTI_FUNC_DEF
Diffstat (limited to 'Src/text.c')
| -rw-r--r-- | Src/text.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Src/text.c b/Src/text.c index 5cd7685fd..56127c457 100644 --- a/Src/text.c +++ b/Src/text.c @@ -578,11 +578,16 @@ gettext2(Estate state) Wordcode end = p + WC_FUNCDEF_SKIP(code); int nargs = *state->pc++; + if (nargs > 1) + taddstr("function "); taddlist(state, nargs); if (nargs) taddstr(" "); if (tjob) { - taddstr("() { ... }"); + if (nargs > 1) + taddstr("{ ... }"); + else + taddstr("() { ... }"); state->pc = end; if (!nargs) { /* @@ -594,7 +599,10 @@ gettext2(Estate state) } stack = 1; } else { - taddstr("() {"); + if (nargs > 1) + taddstr("{"); + else + taddstr("() {"); tindent++; taddnl(1); n = tpush(code, 1); |
