From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26964 invoked by alias); 31 Mar 2018 17:27:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42573 Received: (qmail 28036 invoked by uid 1010); 31 Mar 2018 17:27:54 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-10.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(80.0.253.74):SA:0(-1.9/5.0):. Processed in 10.130234 secs); 31 Mar 2018 17:27:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Originating-IP: [82.132.227.165] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=c8SFvy1l c=1 sm=1 tr=0 a=rcsK0zk0/XFn15R4Ir96Sw==:117 a=rcsK0zk0/XFn15R4Ir96Sw==:17 a=IkcTkHD0fZMA:10 a=x7bEGLp0ZPQA:10 a=BrDiTsk0AAAA:8 a=j-VGWhmqUdt-S0m0bCQA:9 a=fLHcLw4E_0JMuPF8:21 a=KtVAOFHnbfCGnGZE:21 a=QEXdDO2ut3YA:10 a=fK1jZSgjKPFatbRoI9mg:22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1522516645; bh=g/xhuXBG3keMI8JJODqEcjOVNgoSHWzQohNEQBjZFsw=; h=Date:In-Reply-To:References:Subject:To:From; b=MqRKoMQ+XRQkE9389qB68nn1fOxWY/iwLPasvOrEwq+C4mfZXYNBxW3+u3BviovaE iu6aMJZdIdh+gO3QXRVgkclettPw3jvoUX8KMI7WFCzH5KwPkkPtJ3E0vWXACrAUfh FD0gWOc5Kza4mXcjIbgnWxT8pCvvzACqvNIirV6nXkvl8NivOhkyVIRQfPMYl3IIT3 CAQBELCfGErR2mQa0+kCx7YOG+USGIKl+OkZBiZSCWxjv4CzwHfy9wS0z68YHp09tj ComgfXf9qNlRUpzM4ePvLxvOtQ7Yr5XxSzmo9gLAymvKXupuV2zbf5Icd7ix9+ifWw bvqx+qYt3V0iw== Date: Sat, 31 Mar 2018 18:17:21 +0100 User-Agent: K-9 Mail for Android In-Reply-To: <9531.1522231067@thecus> References: <5777.1522148738@thecus> <20180327125641.3df8e5a1@camnpupstephen.cam.scsc.local> <9531.1522231067@thecus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: lexer issue To: zsh-workers@zsh.org From: Peter Stephenson Message-ID: <4294A9D0-3BF2-4EE5-8C7E-743DCFE2D2DD@ntlworld.com> X-CMAE-Envelope: MS4wfO6k4itxdwQA8vxlq3h0ci0khaF4CjnIzfVZLpxt2HJD1qx2+RH4gamwcbXy7WV29EZ7k+qzvm3vA1D5iSlA6mLiQ4OhWwSS6JVZcHQ93xn6CAi8ELLs NspTQQLCQLpY87fPaNE/cg60DTenmtIJdtptpY9OMVqZwnnUrb9mQccWc4PhVFspfa7yYzAnKdYt7Q== On 28 March 2018 10:57:47 BST, Oliver Kiddle wro= te: >Peter wrote: >> Oliver Kiddle wrote: >> > Does anyone know what may be causing this: >> >=20 >> > echo $(( ((##h << 8) + ##e) << 8)+ >> > ??? echo $(( ((##h << 8) + >> >=20 >> > This is with space bound to magic-space=2E >> >> This will be to do with the fact that you've closed one of the >> parentheses of the arithmetic expression, but not the other, so the >next >> expansion has decided it's a command substitution=2E In that, the ##e >is >> a comment, so gets stripped=2E In fact, I'm not seeing the effect you >> are, which may be down to options, or to the fact that the way we >handle >> interactive comments changed recently, or a combination=2E Sorry, limited network access at the moment so partial poorly formatted reply=2E This is indeed because it looks like a command subst that went wrong=2E I think the math aspect is actually irrelevant=2E >It can be reproduced starting from zsh -f with nothing more than > bindkey ' ' magic-space >So interactive_comments is not set=2E That appears to be important but I'm not sure why=2E However, I think I do understand the basics of this=2E When we do the recursive parse of the command subst we abort and flush the history on failure=2E But inside a string it doesn't bother finishing off the history line=2E That's important in this case because we're using that line directly as the string we get from the nested lex=2E Full patch when my laptop finds its way to Wi-Fi but for a taster: In herrflush() , !strin should be (!strin || lex_add_raw) for which=20 the static before lex_add_raw in lex=2E c has to go; inside the loop, in addition to hwaddc() the return from ingetc() has also to be passed to addtoline()=2E The !lexstop tests need tweaking as a consequence= =2E If that was too garbled I will be doing this properly next week=2E=20 Haven't seen any side effects but they are endemic in the lexer / ZLE interface so some playing around wil be necessary=2E=20 pws