Skip to content

[css-mixins-1] @function grammar is missing open-paren #13046

@ferdnyc

Description

@ferdnyc

The definition of the @function syntax is:

<pre class="prod def" nohighlight>
&lt;@function> = @function <<function-token>> <<function-parameter>>#? )
	[ returns <<css-type>> ]?
{
	<<declaration-rule-list>>
}

<dfn><<function-parameter>></dfn> = <<custom-property-name>> <<css-type>>? [ : <<default-value>> ]?
<dfn><<css-type>></dfn> = <<syntax-component>> | <<@function/type()>>
<dfn><<default-value>></dfn> = <<declaration-value>>
<dfn function lt="type()" for="@function">&lt;type()></dfn> = type( <<syntax>> )
</pre>

The literal close-paren ()) that follows the <function-parameter> list is represented, but the open paren (() that should fall between the <function-token> and the (optional) parameter list is not.

The simplest solution is for the grammar to read:

<pre class="prod def" nohighlight>
&lt;@function> = @function <<function-token>> ( <<function-parameter>>#? )
	[ returns <<css-type>> ]?
{
	<<declaration-rule-list>>
}

<dfn><<function-parameter>></dfn> = <<custom-property-name>> <<css-type>>? [ : <<default-value>> ]?
<dfn><<css-type>></dfn> = <<syntax-component>> | <<@function/type()>>
<dfn><<default-value>></dfn> = <<declaration-value>>
<dfn function lt="type()" for="@function">&lt;type()></dfn> = type( <<syntax>> )
</pre>

Unless <function-token> is meant to include the open-paren, but since it isn't defined that way anywhere (formally or informally), that seems unlikely.

(Also, it would make more sense structurally if <function-token> were then defined to include not only the open-paren, but also the argument list and the close-paren. Its definition could then be decomposed further.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions