zsh-users
 help / color / mirror / code / Atom feed
From: segal@morgan.com (Morris M. Siegel)
To: schaefer@nbn.com, Zoltan Hidvegi <hzoli@cs.elte.hu>,
	zsh-users@math.gatech.edu
Subject: Re: Bug in case stmt with '('
Date: Mon, 22 Jul 1996 15:26:46 -0400	[thread overview]
Message-ID: <9607221526.ZM3177@morgan.com> (raw)
In-Reply-To: "Bart Schaefer" <schaefer@candle.brasslantern.com> "Re: Bug in case stmt with '('" (Jul 21, 11:31pm)

> 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.


  parent reply	other threads:[~1996-07-22 19:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-17 21:01 Morris M. Siegel
1996-07-18 18:27 ` Bart Schaefer
1996-07-18 23:43   ` Zoltan Hidvegi
1996-07-19  2:23     ` Bart Schaefer
1996-07-19 16:00       ` Zoltan Hidvegi
1996-07-21 22:53         ` Morris M. Siegel
1996-07-22  6:31           ` Bart Schaefer
     [not found]             ` <schaefer@candle.brasslantern.com>
1996-07-22 19:26               ` Morris M. Siegel [this message]
1996-07-22 19:51                 ` Zoltan Hidvegi
1996-07-22 20:48                   ` Morris M. Siegel
1996-07-22 21:27                     ` Zefram
1996-07-22 21:56                       ` Morris M. Siegel
1996-07-22 21:51                     ` Bart Schaefer
1996-07-22 21:23                   ` Zefram
1996-07-22 22:31               ` Morris M. Siegel
1996-07-22 23:37                 ` Bart Schaefer
1996-07-24 16:07     ` Morrie is off for July 25 Morris M. Siegel

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=9607221526.ZM3177@morgan.com \
    --to=segal@morgan.com \
    --cc=hzoli@cs.elte.hu \
    --cc=schaefer@nbn.com \
    --cc=zsh-users@math.gatech.edu \
    /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).