From e3182c18de8f84c2d7eb003f9c731ada5e9a591f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 8 Dec 2011 19:42:07 +0000 Subject: 29955++: IGNORE_CLOSE_BRACES option --- Doc/Zsh/grammar.yo | 4 ++-- Doc/Zsh/options.yo | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo index 5c803a681..30fec79c6 100644 --- a/Doc/Zsh/grammar.yo +++ b/Doc/Zsh/grammar.yo @@ -449,8 +449,8 @@ tt(do done esac then elif else fi for case if while function repeat time until select coproc nocorrect foreach end ! [[ { }) -Additionally, `tt(})' is recognized in any position if the tt(IGNORE_BRACES) option -is not set. +Additionally, `tt(})' is recognized in any position if neither the +tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set. texinode(Comments)(Aliasing)(Reserved Words)(Shell Grammar) sect(Comments) cindex(comments) diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 0e0176227..68247264f 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -548,7 +548,32 @@ cindex(disabling brace expansion) cindex(brace expansion, disabling) cindex(expansion, brace, disabling) item(tt(IGNORE_BRACES) (tt(-I)) )( -Do not perform brace expansion. +Do not perform brace expansion. For historical reasons this +also includes the effect of the tt(IGNORE_CLOSE_BRACES) option. +) +pindex(IGNORE_CLOSE_BRACES) +pindex(NO_IGNORE_CLOSE_BRACES) +pindex(IGNORECLOSEBRACES) +pindex(NOIGNORECLOSEBRACES) +item(tt(IGNORE_CLOSE_BRACES))( +When neither this option nor tt(IGNORE_BRACES) is set, a sole +close brace character `tt(})' is syntactically significant at any +point on a command line. This has the effect that no semicolon +or newline is necessary before the brace terminating a function +or current shell construct. When either option is set, a closing brace +is syntactically significant only in command position. Unlike +tt(IGNORE_BRACES), this option does not disable brace expansion. + +For example, with both options unset a function may be defined +in the following fashion: + +example(args() { echo $# }) + +while if either option is set, this does not work and something +equivalent to the following is required: + +example(args() { echo $#; }) + ) pindex(KSH_GLOB) pindex(NO_KSH_GLOB) -- cgit 1.4.1