Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000839 [1003.1(2013)/Issue7+TC1] Shell and Utilities Objection Error 2014-05-08 18:51 2019-06-10 08:54
Reporter rhansen View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Richard Hansen
Organization BBN
User Reference
Section 2.10.2 (Shell Grammar Rules) rule 7.b.
Page Number 2349
Line Number 74755-74761
Interp Status Approved
Final Accepted Text See Note: 0002248
Summary 0000839: problems with reduction of WORD to ASSIGNMENT_WORD
Description XCU 2.10.2 rule 7.b. has the following issues:
  * Rule 7.b. should not return WORD -- it should instead defer to
    rule 1 to allow implementations to add reserved words that contain
    equals signs.
  * The rule is missing the "else" case (it should say to apply rule 1
    if there is no <equals-sign> character).
  * Neither quoted <equals-sign> characters nor <equals-sign>
    characters in embedded parameter expansion, command substitution,
    or arithmetic expansion constructs should be considered when
    determining whether to apply rule 1 or return ASSIGNMENT_WORD.

Note that the last bullet point above is the subject of 0000643. The resolution of 0000643 does not completely solve the described problem, repeated here:

Each of the following:
    ${foo=bar}
    $(foo=bar; baz)
    $((foo=bar))
    ~foo=bar/baz
    "foo=bar"
    foo\=bar
is one token according to XCU 2.3. According to XCU 2.10.2, the tokens match cmd_name, so rule 7a is applied. Each token contains an equals sign, so rule 7a says to apply rule 7b. The tokens do not begin with '=', nor do all characters preceding '=' form a valid name, so according to 7b it is unspecified whether ASSIGNMENT_WORD or WORD is returned. All of these cases should return WORD.
Desired Action After applying the changes in 0000643, change XCU 2.10.2 (Shell
Grammar Rules) rule 7.b. page 2349 lines 74755-74761 from:

    If the TOKEN contains the <equals-sign> character:

      * If it begins with '=', the token WORD shall be returned.
      * If all the characters in the TOKEN preceding the first '='
        form a valid name (see XBD Section 3.231), the token
        ASSIGNMENT_WORD shall be returned. (Quoted characters cannot
        participate in forming a valid name.)
      * Otherwise, it is unspecified whether it is ASSIGNMENT_WORD or
        WORD that is returned.

to:

    If the TOKEN contains an unquoted (as determined while applying
    rule #4 from section 2.3) <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 section 2.3):

      * If the TOKEN begins with '=', then rule 1 shall be applied.
      * If all the characters in the TOKEN preceding the first such
        <equals-sign> form a valid name (see XBD Section 3.231), the
        token ASSIGNMENT_WORD shall be returned. (Quoted characters
        cannot participate in forming a valid name.)
      * Otherwise, it is unspecified whether rule 1 is applied or
        ASSIGNMENT_WORD is returned.

    Otherwise, rule 1 shall be applied.
Tags tc2-2008
Attached Files

- Relationships
related to 0000643Closedajosey 1003.1(2008)/Issue 7 Reduction of TOKEN to WORD or ASSIGNMENT_WORD broken when TOKEN contains an equals sign 
parent of 0001276Closed 1003.1(2013)/Issue7+TC1 incorrect resolution in 0000839 

-  Notes
(0002248)
rhansen (manager)
2014-05-22 15:42
edited on: 2014-05-22 15:51

Interpretation response
------------------------
The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
None.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
After applying the changes in 0000643, change XCU 2.10.2 (Shell Grammar Rules) rule 7.b. page 2349 lines 74755-74761 from:

    If the TOKEN contains the <equals-sign> character:

      * If it begins with '=', the token WORD shall be returned.
      * If all the characters in the TOKEN preceding the first '='
        form a valid name (see XBD Section 3.231), the token
        ASSIGNMENT_WORD shall be returned. (Quoted characters cannot
        participate in forming a valid name.)
      * Otherwise, it is unspecified whether it is ASSIGNMENT_WORD or
        WORD that is returned.

to:

    If the TOKEN contains an unquoted (as determined while applying
    rule #4 from section 2.3) <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 section 2.3):

      * If the TOKEN begins with '=', then rule 1 shall be applied.
      * If all the characters in the TOKEN preceding the first such
        <equals-sign> form a valid name (see XBD Section 3.231), the
        token ASSIGNMENT_WORD shall be returned.
      * Otherwise, it is unspecified whether rule 1 is applied or
        ASSIGNMENT_WORD is returned.

    Otherwise, rule 1 shall be applied.

(0002251)
ajosey (manager)
2014-05-23 13:18

Interpretation Proposed 23 May 2014
(0002276)
ajosey (manager)
2014-06-25 10:12

Interpretation approved 25 June 2014

- Issue History
Date Modified Username Field Change
2014-05-08 18:51 rhansen New Issue
2014-05-08 18:51 rhansen Name => Richard Hansen
2014-05-08 18:51 rhansen Organization => BBN
2014-05-08 18:51 rhansen Section => 2.10.2 (Shell Grammar Rules) rule 7.b.
2014-05-08 18:51 rhansen Page Number => 2349
2014-05-08 18:51 rhansen Line Number => 74755-74761
2014-05-22 15:25 nick Relationship added related to 0000643
2014-05-22 15:42 rhansen Note Added: 0002248
2014-05-22 15:51 rhansen Note Edited: 0002248
2014-05-22 15:55 Don Cragun Interp Status => Pending
2014-05-22 15:55 Don Cragun Final Accepted Text => See Note: 0002248
2014-05-22 15:55 Don Cragun Status New => Interpretation Required
2014-05-22 15:55 Don Cragun Resolution Open => Accepted As Marked
2014-05-22 15:56 Don Cragun Tag Attached: tc2-2008
2014-05-23 13:18 ajosey Interp Status Pending => Proposed
2014-05-23 13:18 ajosey Note Added: 0002251
2014-06-25 10:12 ajosey Interp Status Proposed => Approved
2014-06-25 10:12 ajosey Note Added: 0002276
2019-06-10 08:54 agadmin Status Interpretation Required => Closed
2019-07-30 14:26 eblake Relationship added parent of 0001276


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker