Function definition grammar is wrong

The reference page on compound statements contains pseudo-grammar of the function definition syntax:

funcdef                   ::=  [decorators] "def" funcname [type_params] "(" [parameter_list] ")" ["->" expression] ":" suite
decorators                ::=  decorator+
decorator                 ::=  "@" assignment_expression NEWLINE
parameter_list            ::=  defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
                               | parameter_list_no_posonly
parameter_list_no_posonly ::=  defparameter ("," defparameter)* ["," [parameter_list_starargs]]
                               | parameter_list_starargs
parameter_list_starargs   ::=  "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]]
                               | "**" parameter [","]
parameter                 ::=  identifier [":" expression]
defparameter              ::=  parameter ["=" expression]
funcname                  ::=  identifier

According to this grammar, the statement

def foo(*): pass

should be a valid function declaration.

This disagrees with the full grammar specification and actual interpreter behaviour: it throws

SyntaxError: named arguments must follow bare *

More explanation needed. You see claiming that * should be a valid parameter list and hence a valid defparameter, parameter, and identifier. What do you think i am missing?

Perhaps, I see problem.

The parameter_list is ORed expression, one alternative of which is parameter_list_no_posonly. That one - also ORed expression with alternative:

parameter_list_starargs   ::=  "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]] | "**" parameter [","]

With the first variant of the parameter_list_starargs syntax - all could be optional, except the *.

Yes, this is correct.

I see that now. Do you have a suggested revision?

I suggest something like

parameter_list_starargs   ::=  "*" parameter ("," defparameter)* ["," [parameter_star_kwargs]]
                               | "*" ("," defparameter)+ ["," [parameter_star_kwargs]]
                               | parameter_star_kwargs
parameter_star_kwargs     ::= "**" parameter [","]

Does make sense for me. Would you like to create an issue and pr?