From bced1beb8cc530ea28aa994808707043dd156fb8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 20 Jan 2016 07:47:53 +0000 Subject: 37700: Teach ${(z)} the 'repeat WORD SUBLIST' syntax. --- Src/lex.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Src/lex.c') 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, "]]")) { -- cgit 1.4.1