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
0001097 [1003.1(2016/18)/Issue7+TC2] Shell and Utilities Editorial Error 2016-10-20 15:24 2016-10-27 18:09
Reporter Mark_Galeck View Status public  
Assigned To
Priority normal Resolution Withdrawn  
Status Closed  
Name Mark Galeck
Organization
User Reference
Section 2.10.2 Shell Grammar Rules
Page Number 2376, 2379
Line Number 75919, 75920, 76068, 76069
Interp Status ---
Final Accepted Text
Summary 0001097: Shell Grammar rule 4 is nonsense that conflicts with existing implementations
Description According to the production

pattern: WORD /* Apply rule 4 */

the input:

case foobar in (esac) esac

should not accept, because the first 'esac' would be identified as token Esac, and not WORD, according to rule 4.

This is of course nonsense, and indeed, both dash and bash have no problem accepting the above.

Moreover, the production

pattern : pattern '|' WORD /* Do not apply rule 4 */

is nonsense as well. Because we are told that rule 4 does not apply, we apply the default rule 1, according to which, again, 'esac' would be Esac here, not WORD, so that

 case foobar in (esac|esac) esac

should again not accept. But of course it does in the existing implementations, as well it should.
Desired Action Nuke rule 4, it makes no sense and does not apply, anywhere.

Change the pattern productions to:

pattern: WORD /*TOKEN is always WORD here*/
        | pattern '|' WORD /*TOKEN is always WORD here*/
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0003447)
geoffclare (manager)
2016-10-21 08:32

I agree there is a problem here, but the suggested solution is not right.

Rule 4 is needed for this case:

$ case foobar in
> esac)
-bash: syntax error near unexpected token `)'

Maybe there is a way to fix it by rewording rule 4 to distinguish between pattern) and (pattern). If not, we'll need to change the grammar somehow (perhaps by introducing a pattern_or_esac production).
(0003461)
Mark_Galeck (reporter)
2016-10-27 12:43

This report is included in the summary report 1100 and can be cancelled.
(0003474)
Don Cragun (manager)
2016-10-27 18:09

Withdrawn by submitter per Note: 0003461

- Issue History
Date Modified Username Field Change
2016-10-20 15:24 Mark_Galeck New Issue
2016-10-20 15:24 Mark_Galeck Name => Mark Galeck
2016-10-20 15:24 Mark_Galeck Section => 2.10.2 Shell Grammar Rules
2016-10-20 15:24 Mark_Galeck Page Number => 2376, 2379
2016-10-20 15:24 Mark_Galeck Line Number => 75919, 75920, 76068, 76069
2016-10-21 08:32 geoffclare Note Added: 0003447
2016-10-27 12:43 Mark_Galeck Note Added: 0003461
2016-10-27 18:09 Don Cragun Interp Status => ---
2016-10-27 18:09 Don Cragun Note Added: 0003474
2016-10-27 18:09 Don Cragun Status New => Closed
2016-10-27 18:09 Don Cragun Resolution Open => Withdrawn


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