[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: select syntax violates the POLA
From: |
konsolebox |
Subject: |
Re: select syntax violates the POLA |
Date: |
Fri, 2 Apr 2021 23:21:03 +0800 |
On Fri, Apr 2, 2021 at 3:03 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Apr 02 2021, Robert Elz wrote:
>
> > Date: Thu, 01 Apr 2021 21:33:31 -0400
> > From: worley@alum.mit.edu (Dale R. Worley)
> > Message-ID: <874kgpqxlg.fsf@hobgoblin.ariadne.com>
> >
> > | I was going to ask why "else {" works,
> >
> > Wrong question. That one is easy. What follows
> > 'else' is a list and the simplest form of a list
> > is a simple command, which starts with a command
> > word, so reserved words are always going to work
> > there, even without the "follows a reserved word'
> > rule.
> >
> > The right question would be why '} else' works.
>
> The two case are not really different, they are covered by the same
> rule:
>
> This recognition shall only occur when none of the characters is
> quoted and when the word is used as:
>
> * The first word following one of the reserved words other than
> case, for, or in
>
That's not a rule but a special compromise. [[ ]] and (( )) are a
form of reserved words themselves just like () and {} as they can be
used multi-line but they aren't allowed to be adjacent to else et al
without a semicolon. [[ ]], (( )), {}, and () are practically just
commands with first-class parsing that consistently have to end with a
semicolon if followed by another reserved word or command.
--
konsolebox
- select syntax violates the POLA, greywolf, 2021/04/01
- Re: select syntax violates the POLA, Greg Wooledge, 2021/04/01
- Re: select syntax violates the POLA, Chet Ramey, 2021/04/01
- Re: select syntax violates the POLA, Dale R. Worley, 2021/04/01
- Re: select syntax violates the POLA, Robert Elz, 2021/04/01
- Re: select syntax violates the POLA, Andreas Schwab, 2021/04/02
- Re: select syntax violates the POLA,
konsolebox <=
- Re: select syntax violates the POLA, Greywolf, 2021/04/05
- Re: select syntax violates the POLA, Chet Ramey, 2021/04/05
- Re: select syntax violates the POLA, Greywolf, 2021/04/05
- Re: select syntax violates the POLA, Chet Ramey, 2021/04/05
- Re: select syntax violates the POLA, konsolebox, 2021/04/02
- Re: select syntax violates the POLA, Robert Elz, 2021/04/02
- Re: select syntax violates the POLA, konsolebox, 2021/04/05
- Re: select syntax violates the POLA, Greywolf, 2021/04/05
- Re: select syntax violates the POLA, Robert Elz, 2021/04/02
- Re: select syntax violates the POLA, Dale R. Worley, 2021/04/04