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 | a090acab63c02900e86bd268fc9194fccf459d08 (diff) | |
download | zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar.gz zsh-bced1beb8cc530ea28aa994808707043dd156fb8.tar.xz 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
diff --git a/Src/lex.c b/Src/lex.c index 23b0a1cd9..d4132fe76 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -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, "]]")) { |