[sv-bc] BNF too restrictive for macro actual arg

From: Greg Jaxon <Greg.Jaxon_at_.....>
Date: Mon Jul 07 2008 - 19:31:41 PDT
Syntax 21-3 says:

> text_macro_usage ::=
>         `text_macro_identifier [ ( list_of_actual_arguments ) ]
> list_of_actual_arguments ::=
>         actual_argument { , actual_argument }
> actual_argument ::=
>         expression

But surely the actuals are not required to be expressions.

Accompanying text says only that:
> To use a macro defined with arguments, the name of the text macro shall be followed by a list of actual argu-
> ments in parentheses, separated by commas. Actual arguments and defaults shall not contain comma or right
> parenthesis characters outside matched pairs of left and right parentheses (), square brackets [], braces {},
> double quotes "", or an escaped identifier.

and further offers this:
> An actual argument may be empty or white space only, in which case the formal argument is substituted by
> the argument default if one is specified or by nothing if no default is specified.

I think the BNF production should simply say

         actual_argument ::=  {any_character}¹

with the footnote containing or referring to the more subtle restrictions I quoted above.

Greg


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Jul 7 19:32:18 2008

This archive was generated by hypermail 2.1.8 : Mon Jul 07 2008 - 19:33:01 PDT