On 19/02/2021 16:21, Geoff Clare via austin-group-l at The Open Group wrote:
It may be prudent to clarify matters by rearranging things in the
grammar so that it ends up saying "Do not apply rule 4" when a '('
has just been seen, like it does when a '|' has just been seen.

That sounds good. I think that can be done by moving '(' and ')' from the case_item[_ns] rules into the pattern rule, as follows:

  case_item_ns      : pattern linebreak
                    | pattern compound_list
                    ;
  case_item         : pattern linebreak     DSEMI linebreak
                    | pattern compound_list DSEMI linebreak
                    ;
  pattern           : pattern_head ')'
                    ;
  pattern_head      :                  WORD /* Apply rule 4 */
                    |              '(' WORD /* Do not apply rule 4 */
                    | pattern_head '|' WORD /* Do not apply rule 4 */
                    ;

It is a bit odd to have '(' and ')' part of the pattern rule like this, since they are not part of any pattern as far as the semantics of the case statement are concerned, but neither is '|' and that is already part of the pattern rule too.

Cheers,
Harald van Dijk

  • Re: [1003.1(2016/18)/... Geoff Clare via austin-group-l at The Open Group
    • Re: [1003.1(2016... Harald van Dijk via austin-group-l at The Open Group
      • Re: [1003.1(... Geoff Clare via austin-group-l at The Open Group
        • Re: [100... Harald van Dijk via austin-group-l at The Open Group
          • Re: ... Geoff Clare via austin-group-l at The Open Group
            • ... Donn Terry via austin-group-l at The Open Group
            • ... Chet Ramey via austin-group-l at The Open Group
            • ... Harald van Dijk via austin-group-l at The Open Group
            • ... Geoff Clare via austin-group-l at The Open Group
            • ... Chet Ramey via austin-group-l at The Open Group
            • ... Harald van Dijk via austin-group-l at The Open Group
            • ... Geoff Clare via austin-group-l at The Open Group
            • ... Harald van Dijk via austin-group-l at The Open Group
            • ... Chet Ramey via austin-group-l at The Open Group
            • ... Geoff Clare via austin-group-l at The Open Group
            • ... Chet Ramey via austin-group-l at The Open Group
            • ... Robert Elz via austin-group-l at The Open Group
        • Re: [100... Robert Elz via austin-group-l at The Open Group
          • Re: ... Harald van Dijk via austin-group-l at The Open Group
            • ... Joerg Schilling via austin-group-l at The Open Group
            • ... Harald van Dijk via austin-group-l at The Open Group

Reply via email to