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: Mon, 18 May 2015 11:53:01 +0100	[thread overview]
Message-ID: <20150518115301.0c80918d@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CAJ1KOAh9_WHM9WS_NKXFy9Dhqrsupi+xT36euHLq9iaWaZ_oig@mail.gmail.com>

On Mon, 18 May 2015 13:29:03 +0300
İsmail Dönmez <ismail@donmez.ws> wrote:
> vim <tab> results in:
> 
> _vim:7: parse error near `('
> 
> I guess it needs extra quoting but not sure where, so no patch attached :/

No, that's a snafu with getting the right lexical analysis mode for the
pattern.  Was OK for the first one, but got screwed up after "|",
and _vim happens to have a pattern begining with a parenthesis
after a "|".

Thanks for being up to date...

BTW for backward compatibility I'll also need to special case (|...)
which used to match an empty string but is now a parse error.  Should
get around to all that some time this week but it's a busy week...

pws

diff --git a/Src/parse.c b/Src/parse.c
index c938d2d..c486699 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1174,8 +1174,6 @@ par_case(int *cmplx)
 	if (!strcmp(tokstr, "esac"))
 	    break;
 	str = dupstring(tokstr);
-	incasepat = 0;
-	incmdpos = 1;
 	type = WC_CASE_OR;
 	pp = ecadd(0);
 	palts = ecadd(0);
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 1ba0a54..41fb486 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -543,6 +543,7 @@
   . ./bad_syntax
 126: Attempt to "." file with bad syntax.
 ?./bad_syntax:2: parse error near `\n'
+# `
 
   echo 'false' >dot_false
   . ./dot_false
@@ -650,3 +651,17 @@
 >Pattern matched five
 >Pattern matched six
 >Character class matched abecedinarian
+
+  case grumph in
+    ( no | (grumph) )
+    print 1 OK
+    ;;
+  esac
+  case snruf in
+    ( fleer | (|snr(|[au]f)) )
+    print 2 OK
+    ;;
+  esac
+0: case patterns within words
+>1 OK
+>2 OK


  reply	other threads:[~2015-05-18 10:53 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 [this message]
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
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=20150518115301.0c80918d@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).