Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.0
Date: Fri, 15 Jan 2016 06:26:48 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: bufferwords() lexes a subshell in a shortloop repeat as a string
Message-ID: <20160115062648.GA14019@tarsus.local2>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 37635

The ${(z)} modifier gives me a subshell as a single unit:

    % pz() { print -rl - ${(qq)${(z)1}} } 
    % pz 'repeat 3 (echo this is a subshell)'
    'repeat'
    '3'
    '(echo this is a subshell)'

I expected the subshell to be broken into '(', 'echo', …, ')' tokens, as
per usual.

Looking at it in gdb, I see (after the third call to ctxtlex()):
    tok == STRING
    tokstr == "(echo this is a subshell)"

Cheers,

Daniel

