Chromium Code Reviews| Index: docs/language/dartLangSpec.tex |
| diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex |
| index 140a8df4fafc328bc0b4fd246f9ad83805d0d7b9..1adef87f9fac2925d62f0f670b3bcdfd91d89cba 100644 |
| --- a/docs/language/dartLangSpec.tex |
| +++ b/docs/language/dartLangSpec.tex |
| @@ -655,9 +655,11 @@ The body of a function introduces a new scope known as the function's {\em body |
| It is a compile-time error if a formal parameter is declared as a constant variable (\ref{variables}). |
| \begin{grammar} |
| -{\bf formalParameterList:}`(' `)'; |
| - `(' normalFormalParameters ( `,' optionalFormalParameters)? `)'; |
| - `(' optionalFormalParameters `)' |
| +{\bf formalParameterList:} |
| + `(' `)'; |
| + `(' normalFormalParameters `,'? `)'; |
| + `(' normalFormalParameters `,' optionalFormalParameters `)'; |
| + `(' optionalFormalParameters `)' |
| . |
| %\end{grammar} |
| %} |
| @@ -673,18 +675,21 @@ It is a compile-time error if a formal parameter is declared as a constant varia |
| normalFormalParameter (`,' normalFormalParameter)* |
| . |
| -{\bf optionalFormalParameters:}optionalPositionalFormalParameters; |
| +{\bf optionalFormalParameters:} |
| + optionalPositionalFormalParameters; |
| namedFormalParameters |
| . |
| {\bf optionalPositionalFormalParameters:} |
| - `[' defaultFormalParameter (`,' defaultFormalParameter)* `]' |
| + `[' defaultFormalParameter (`,' defaultFormalParameter)* `,'? `]' |
| . |
| {\bf namedFormalParameters:} |
| - `\{' defaultNamedParameter (`,' defaultNamedParameter)* `\}' |
| + `\{' defaultNamedParameter (`,' defaultNamedParameter)* `,'? `\}' |
| . |
| \end{grammar} |
| +Formal parameter lists allow an optional trailing comma after the last parameter ($`,'?$). A parameter list with such a trailing comma is equivalent in all ways to one without the trailing comma. All parameter lists in this specification are shown without a trailing comma, but the rules and semantics apply equally to a parameter list with a trailing comma. |
|
eernst
2016/06/27 12:47:06
'to one without' --> 'to the same parameter list w
Lasse Reichstein Nielsen
2016/07/01 10:12:36
Done.
|
| + |
| %Formal parameters are always \FINAL{}. |
| %\Q{We're awaiting some data on whether enforcing this would cause widespread pain.} |
| %A formal parameter is always considered to be initialized. \rationale{This is because it will always be initialized by the call - even if it is optional.} |
| @@ -3608,10 +3613,11 @@ Function invocation involves evaluation of the list of actual arguments to the f |
| \begin{grammar} |
| {\bf arguments:} |
| - `(' argumentList? `)' |
| + `(' (argumentList `,'?)? `)' |
| . |
| -{\bf argumentList:}namedArgument (`,' namedArgument)*; |
| +{\bf argumentList:} |
| + namedArgument (`,' namedArgument)*; |
| % expressionList ',' spreadArgument; |
| expressionList (`,' namedArgument)* |
| % spreadArgument |
| @@ -3622,6 +3628,8 @@ Function invocation involves evaluation of the list of actual arguments to the f |
| . |
| \end{grammar} |
| +Argument lists allow an optional trailing comma after the last argument ($`,'?$). An argument list with such a trailing comma is equivalent in all ways to one without the trailing comma. All argument lists in this specification are shown without a trailing comma, but the rules and semantics apply equally to an argument list with a trailing comma. |
| + |
|
eernst
2016/06/27 12:47:06
Same changes: 'to the same parameter list without
|
| \LMHash{} |
| Evaluation of an actual argument list of the form |