zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: vim completion problem after workers/35168
Date: Tue, 19 May 2015 09:44:29 +0100	[thread overview]
Message-ID: <20150519094429.6880cf81@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20150519013457.GA2024@tarsus.local2>

Bart Schaefer wrote on Mon, May 18, 2015 at 17:30:34 -0700:
> Hrm.  Zsh patterns include "(this|that)", and "case" syntax includes
> "pattern)" without an open paren, so ...?

The problem is that the initial "(" now has to introduce a set of words
(with whitespace that's optional in most but not all cases) rather than
a single zsh pattern.  If you find an extraneous ")" at the end it's too
late to decide you should have been parsing a single pattern rather than
a set of alternative patterns.  We got away with this before by hacking
the pattern ex post facto in one case but not the other.

We could in principle read it as before and re-parse it, but that's
creating a bug-prone mess to fix a case I doubt happens very often (the
_vim code was clearly intended to have balanced parentheses all along).

> The "old hack" is one of those "well, it really should have been done
> differently in the first place, but it wasn't, so now what?" issues
> that bug me because *somebody* is going to get bitten in the way _vim
> just was.

Yes, we're in rather a corner over this.  But I'm still hoping the nasty
cases can be kept to a minimum.

On Tue, 19 May 2015 01:34:57 +0000
Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> Is there any case in which the neither pre-35168 code nor post-35168
> code gives a parse error, but the semantics are different?

To the best of my knowledge the new code is stricter.  When I get a
moment to look, any laxness I introduce should be exactly on the lines
of what happened before --- I don't think there's any ambiguity because
after a string either you get a "|" (standard) or another string (zsh
special).

pws


  reply	other threads:[~2015-05-19  8:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 10:29 İsmail Dönmez
2015-05-18 10:53 ` Peter Stephenson
2015-05-18 11:22   ` İsmail Dönmez
2015-05-18 11:40     ` Peter Stephenson
2015-05-18 11:42       ` İsmail Dönmez
2015-05-19  0:30       ` Bart Schaefer
2015-05-19  1:34         ` Daniel Shahaf
2015-05-19  8:44           ` Peter Stephenson [this message]
2015-05-19  6:34         ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150519094429.6880cf81@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).