diff options
| author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-01-20 07:47:53 +0000 |
|---|---|---|
| committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-01-29 09:14:53 +0000 |
| commit | bced1beb8cc530ea28aa994808707043dd156fb8 (patch) | |
| tree | 30b7dca6a24e5a11f6b9b4dd4fd34c73a9f2f098 /Src/lex.c | |
| parent | unposted: _init_d: Report failure to caller. (diff) | |
| download | zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar.gz zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar.bz2 zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar.lz zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar.xz zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar.zst zsh-bced1beb8cc530ea28aa994808707043dd156fb8.zip | |
37700: Teach ${(z)} the 'repeat WORD SUBLIST' syntax.
Diffstat (limited to 'Src/lex.c')
| -rw-r--r-- | Src/lex.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -267,9 +267,13 @@ zshlex(void) { if (tok == LEXERR) return; - do + do { + if (inrepeat_) + ++inrepeat_; + if (inrepeat_ == 3 && isset(SHORTLOOPS)) + incmdpos = 1; tok = gettok(); - while (tok != ENDINPUT && exalias()); + } while (tok != ENDINPUT && exalias()); nocorrect &= 1; if (tok == NEWLIN || tok == ENDINPUT) { while (hdocs) { @@ -1899,6 +1903,7 @@ exalias(void) zshlextext[0] == '}' && !zshlextext[1])) && (rw = (Reswd) reswdtab->getnode(reswdtab, zshlextext))) { tok = rw->token; + inrepeat_ = (tok == REPEAT); if (tok == DINBRACK) incond = 1; } else if (incond && !strcmp(zshlextext, "]]")) { |
