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 JAA11696 for ; Tue, 23 Jul 1996 09:39:24 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id TAA05668; Mon, 22 Jul 1996 19:38:05 -0400 (EDT) Resent-Date: Mon, 22 Jul 1996 19:36:20 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960722163724.ZM10811@candle.brasslantern.com> Date: Mon, 22 Jul 1996 16:37:24 -0700 In-Reply-To: segal@morgan.com (Morris M. Siegel) "Re: Bug in case stmt with '('" (Jul 22, 6:31pm) References: <199607221951.VAA07888@bolyai.cs.elte.hu> <9607221648.ZM3416@morgan.com> <960722145116.ZM10226@candle.brasslantern.com> <9607221831.ZM3714@morgan.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: Zoltan Hidvegi , segal@morgan.com (Morris M. Siegel), 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: <"slGqQ3.0.wN1.p11zn"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/332 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 22, 6:31pm, Morris M. Siegel wrote: } Subject: Re: Bug in case stmt with '(' } } > There's no such thing as "unescaped whitespace in glob patterns." Zsh } > lexes glob patterns as a STRING token. } } Okay -- (not knowing how lex.c works puts me somewhat at a disadvantage) -- } in light of what you say, then what I mean is that the whitespace would have } to be escaped with backslash or quotes to be non-trivial. Unfortunately, glob patterns are not the only STRING tokens. That means that you can't strip out the "trivial" spaces when lexing, without messing up other uses of those tokens. } E.g., the glob pattern } ( file*.* ~ file.c ) } would be equivalent to } (file*.*~file.c) That's exactly what my `if (incasepat && ...)' patch does, except it only does it in the pattern part of case statements. Unfortunately, it breaks this sort of thing: case "foo bar" in (foo bar)|boing) echo yes;; esac because you can't tell until you find the `|' beyond the first ')' that you should not have been stripping out spaces when lexing inside the earlier '('. This works, though: case "foo bar" in ((foo bar)|boing) echo yes;; esac -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"