zsh-workers
 help / color / mirror / code / Atom feed
* Remind me about oddball reserved words
@ 2015-03-28 21:58 Bart Schaefer
  2015-03-28 22:39 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2015-03-28 21:58 UTC (permalink / raw)
  To: zsh-workers

Here's the entire (11 lines) doc for reserved words:

##
6.5 Reserved Words
==================

The following words are recognized as reserved words when used as the
first word of a command unless quoted or disabled using disable -r:

do done esac then elif else fi for case if while function repeat time
until select coproc nocorrect foreach end ! [[ { }

Additionally, `}' is recognized in any position if neither the
IGNORE_BRACES option nor the IGNORE_CLOSE_BRACES option is set.
##

Close brace is recognized as a reserved word in command position?  I've
entirely forgotten why and would like to be reminded.  Also, why close
brace and not close-double-bracket?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remind me about oddball reserved words
  2015-03-28 21:58 Remind me about oddball reserved words Bart Schaefer
@ 2015-03-28 22:39 ` Peter Stephenson
  2015-03-28 23:04   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2015-03-28 22:39 UTC (permalink / raw)
  To: zsh-workers

On Sat, 28 Mar 2015 14:58:51 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> Close brace is recognized as a reserved word in command position?  I've
> entirely forgotten why and would like to be reminded.

I would guess it's to do with the fact that with IGNORE_BRACES (or
IGNORE_CLOSE_BRACES) set, which is old sh style, "}" needs to be in
command position.  I suspect it's not needed in native mode.

> Also, why close brace and not close-double-bracket?

There's no case where ']]' needs to be special in command position, only
at the end of a specially parsed condition.

pws


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remind me about oddball reserved words
  2015-03-28 22:39 ` Peter Stephenson
@ 2015-03-28 23:04   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2015-03-28 23:04 UTC (permalink / raw)
  To: zsh-workers

On Mar 28, 10:39pm, Peter Stephenson wrote:
} Subject: Re: Remind me about oddball reserved words
}
} On Sat, 28 Mar 2015 14:58:51 -0700
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > Close brace is recognized as a reserved word in command position?  I've
} > entirely forgotten why and would like to be reminded.
} 
} I would guess it's to do with the fact that with IGNORE_BRACES (or
} IGNORE_CLOSE_BRACES) set, which is old sh style, "}" needs to be in
} command position.

$ { echo Ahh, yes, that is exactly it.; echo Thanks.; }


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-28 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-28 21:58 Remind me about oddball reserved words Bart Schaefer
2015-03-28 22:39 ` Peter Stephenson
2015-03-28 23:04   ` Bart Schaefer

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