Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: vim completion problem after workers/35168



On Mon, 18 May 2015 13:29:03 +0300
İsmail Dönmez <ismail@xxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author