A NOTE has been added to this issue. 
====================================================================== 
http://austingroupbugs.net/view.php?id=1276 
====================================================================== 
Reported By:                stephane
Assigned To:                
====================================================================== 
Project:                    1003.1(2013)/Issue7+TC1
Issue ID:                   1276
Category:                   Shell and Utilities
Type:                       Error
Severity:                   Objection
Priority:                   normal
Status:                     New
Name:                       Stephane Chazelas 
Organization:                
User Reference:              
Section:                    2.10.2 shell grammar rules 
Page Number:                 
Line Number:                 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2019-07-30 13:11 UTC
Last Modified:              2019-08-20 18:34 UTC
====================================================================== 
Summary:                    incorrect resolution in
http://austingroupbugs.net/view.php?id=839
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0001100 Rewrite of Section 2.10 Shell Grammar, ...
child of            0000839 problems with reduction of WORD to ASSI...
====================================================================== 

---------------------------------------------------------------------- 
 (0004532) stephane (reporter) - 2019-08-20 18:34
 http://austingroupbugs.net/view.php?id=1276#c4532 
---------------------------------------------------------------------- 
Re: http://austingroupbugs.net/view.php?id=1276#c4530

About http://austingroupbugs.net/view.php?id=1276#c4508, yes sorry my bad.

About http://austingroupbugs.net/view.php?id=1276#c4509

That could be: change:

>  simple_command   : cmd_prefix cmd_word cmd_suffix
>                   | cmd_prefix cmd_word
>                   | cmd_prefix
>                   | cmd_name cmd_suffix
>                   | cmd_name
>                   ;
>  cmd_name         : WORD                   /* Apply rule 7a */
>                   ;
>  cmd_word         : WORD                   /* Apply rule 7b */
>                   ;
>  cmd_prefix       :            io_redirect
>                   | cmd_prefix io_redirect
>                   |            ASSIGNMENT_WORD
>                   | cmd_prefix ASSIGNMENT_WORD

to (including http://austingroupbugs.net/view.php?id=1094 resolution (also
included in http://austingroupbugs.net/view.php?id=1279)):

>  simple_command   : cmd_prefix cmd_word cmd_suffix
>                   | cmd_prefix cmd_word
>                   | cmd_prefix
>                   | cmd_word cmd_suffix
>                   | cmd_word
>                   ;
>  cmd_word         : WORD                   /* Apply rule 7 */
>                   ;
>  cmd_prefix       :            io_redirect
>                   | cmd_prefix io_redirect
>                   |            ASSIGNMENT_WORD /* Apply rule 7 */
>                   | cmd_prefix ASSIGNMENT_WORD /* Apply rule 7 */
>  cmd_suffix       :            io_redirect
>                   | cmd_suffix io_redirect
>                   |            WORD
>                   | cmd_suffix WORD

and rule 7 to:

> 7. [Assignment preceding command name]
>
>       * If the TOKEN is exactly a reserved word, the token
>         identifier for that reserved word shall result.
>
>       * Otherwise
>
>         If the TOKEN contains an unquoted (as determined
>         while applying rule 4 from Token Recognition)
>         <equals-sign> character that is not part of an
>         embedded parameter expansion, command substitution,
>         or arithmetic expansion construct (as determined
>         while applying rule 5 from Token Recognition):
>
>            • If the TOKEN begins with '=', then the token
>            WORD shall be returned.
>
>            • If all the characters in the TOKEN preceding
>            the first such <equals-sign> form a valid name
>            (see XBD Name), the token ASSIGNMENT_WORD shall
>            be returned.
>
>            • Otherwise, it is unspecified whether the WORD
>            or ASSIGNMENT_WORD is returned.
>
>       * Otherwise, the token WORD shall be returned.
>
>    Assignment to the name within a returned ASSIGNMENT_WORD
>    token shall occur as specified in Simple Commands.

And remove the "Otherwise, rule 7 applies" from rule 8 which doesn't make
much sense (rule 7 will never yield a NAME token). Or replace with
"Otherwise, a UNSPECIFIED token is returned" (see
http://austingroupbugs.net/view.php?id=1279).


That would specify that "foo=bar for arg" is not any more a valid POSIX sh
"simple command" than "for arg".

And foo=bar() { blah; } would still not be a valid sh function declaration,
as foo=bar would still not be seen as a NAME token. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2019-07-30 13:11 stephane       New Issue                                    
2019-07-30 13:11 stephane       Name                      => Stephane Chazelas
2019-07-30 13:11 stephane       Section                   => 2.10.2 shell
grammar rules
2019-07-30 13:16 stephane       Note Added: 0004501                          
2019-07-30 14:26 eblake         Relationship added       child of 0000839    
2019-07-30 14:27 eblake         Relationship added       related to 0001100  
2019-08-05 14:23 stephane       Note Added: 0004508                          
2019-08-05 14:23 stephane       Note Added: 0004509                          
2019-08-19 10:05 geoffclare     Note Added: 0004530                          
2019-08-19 10:12 geoffclare     Note Edited: 0004530                         
2019-08-20 18:34 stephane       Note Added: 0004532                          
======================================================================


Reply via email to