help / color / mirror / Atom feed
* Re: ${(z)} parsing of multiple array assignments
       [not found]   ` <CAKc7PVCKy2ubK3SybpVAAqpOzqGDcL0LJ=TYN4fAPLMhkyJ3-A@mail.gmail.com>
@ 2019-12-24 23:32     ` Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2019-12-24 23:32 UTC (permalink / raw)
  To: zsh-workers

Sebastian Gniazdowski wrote on Wed, Dec 25, 2019 at 00:16:09 +0100:
> % x='a=(foo) b=() d=(bar)'
> % print -rl -- "${(z)x}"


diff --git a/Src/lex.c b/Src/lex.c
index 1d86da94e..e6f6c8f50 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -340,13 +340,13 @@ ctxtlex(void)
     case ELIF:
     case ELSE:
     case DOUTBRACK:
+    case OUTPAR:
 	incmdpos = 1;
     case STRING:
     case TYPESET:
  /* case ENVSTRING: */
     case ENVARRAY:
-    case OUTPAR:
     case CASE:
     case DINBRACK:
 	incmdpos = 0;

This change fixes all the cases in this thread, and passes all zsh tests and
all z-sy-h tests (which rely heavily on ${(z)} functioning correctly); however,
I don't know whether it's correct.

I'm guessing that the different meaning of parentheses are being confused for
each other:

- Array assignment
- End of subshell
- Function defnition
- Glob qualifier



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-24 23:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191223173115.bvhwbpfmqgqhngle@tarpaulin.shahaf.local2>
     [not found] ` <20191224203408.GA35101@osmium.pennocktech.home.arpa>
     [not found]   ` <CAKc7PVCKy2ubK3SybpVAAqpOzqGDcL0LJ=TYN4fAPLMhkyJ3-A@mail.gmail.com>
2019-12-24 23:32     ` ${(z)} parsing of multiple array assignments Daniel Shahaf


This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:

code repositories for the project(s) associated with this inbox:


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git