Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: lexer issue
- X-seq: zsh-workers 42573
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: lexer issue
- Date: Sat, 31 Mar 2018 18:17:21 +0100
- 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==
- In-reply-to: <9531.1522231067@thecus>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20180327111617epcas3p264cdae264e676ace2503d20bd919ea5e@epcas3p2.samsung.com> <5777.1522148738@thecus> <20180327125641.3df8e5a1@camnpupstephen.cam.scsc.local> <9531.1522231067@thecus>
On 28 March 2018 10:57:47 BST, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>Peter wrote:
>> Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>> > Does anyone know what may be causing this:
>> >
>> > echo $(( ((##h << 8) + ##e) << 8)+<SPACE>
>> > ??? echo $(( ((##h << 8) +
>> >
>> > This is with space bound to magic-space.
>>
>> 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. In that, the ##e
>is
>> a comment, so gets stripped. 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.
Sorry, limited network access at the moment so partial
poorly formatted reply.
This is indeed because it looks like a command subst that
went wrong. I think the math aspect is actually irrelevant.
>It can be reproduced starting from zsh -f with nothing more than
> bindkey ' ' magic-space
>So interactive_comments is not set.
That appears to be important but I'm not sure why.
However, I think I do understand the basics of this.
When we do the recursive parse of the command subst we
abort and flush the history on failure. But inside a string it
doesn't bother finishing off the history line. That's important in
this case because we're using that line directly as the string
we get from the nested lex.
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
the static before lex_add_raw in lex. c has to go; inside the loop, in
addition to hwaddc() the return from ingetc() has also to be
passed to addtoline(). The !lexstop tests need tweaking as a consequence.
If that was too garbled I will be doing this properly next week.
Haven't seen any side effects but they are endemic in the lexer /
ZLE interface so some playing around wil be necessary.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author