From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id FAA11510 for ; Tue, 23 Jul 1996 05:31:14 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id PAA29966; Mon, 22 Jul 1996 15:29:16 -0400 (EDT) Resent-Date: Mon, 22 Jul 1996 15:28:19 -0400 (EDT) From: segal@morgan.com (Morris M. Siegel) Date: Mon, 22 Jul 1996 15:26:46 -0400 Message-Id: <9607221526.ZM3177@morgan.com> In-Reply-To: "Bart Schaefer" "Re: Bug in case stmt with '('" (Jul 21, 11:31pm) References: <199607191600.SAA08613@bolyai.cs.elte.hu> <9607211853.ZM979@morgan.com> <960721233102.ZM22696@candle.brasslantern.com> X-Mailer: Z-Mail (3.2.1 10oct95) To: schaefer@nbn.com, Zoltan Hidvegi , zsh-users@math.gatech.edu Subject: Re: Bug in case stmt with '(' Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"nryND.0.eJ7.JPzyn"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/323 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > So your suggestion would amount to omitting the check for balanced > parens, thus assuming (in the event that a closing paren is not found) > that the glob pattern is correctly formed. This doesn't simplify the > parser in any significant way, and it delays detection of some other > malformed glob patterns. I'm ready to believe that my suggestion doesn't simplify the parser significantly, but I'm _not_ suggesting to forego checking for balanced parens -- on the contrary, I assume the parser would only accept well-formed glob patterns. | required paren v "( x ) )" ^ | optional paren v " x )" What I am suggesting is that the trailing ')' (which if present is UNbalanced) not be required to be present. I.e., each well-formed case-prefix pattern (which may have internal parens or '|'s) is terminated by an [external] '|', ')', or whitespace; if by whitespace, then the parser considers the following token: if it is '|' or ')', then parsing of the case-prefix continues, else the case-prefix is considered complete (the parser regards the whitespace as equivalent to a trailing ')', if you will), and the token is taken to be the initial token of the case-clause body. Accordingly, I believe that detection of malformed glob patterns would not at all be delayed. Perhaps my approach might even make it easier to avoid the remaining problem with Zoltan's current patch.