58
58
% Mar 2023
59
59
% - Clarify how line breaks are handled in a multi-line string literal. Rename
60
60
% the lexical token NEWLINE to LINE\_BREAK (clarifying that it is not `\n`).
61
+ % - Clean up grammar rules (avoid `T?` as a superclass/etc., which is an
62
+ % error anyway; change extension names to `typeIdentifier`, avoiding
63
+ % built-in identifiers).
61
64
%
62
65
% Feb 2023
63
66
% - Change the specification of constant expressions of the form `e1 == e2`
@@ -6064,7 +6067,7 @@ \section{Extensions}
6064
6067
6065
6068
\begin{grammar}
6066
6069
<extensionDeclaration> ::=
6067
- \gnewline{} \EXTENSION{} <identifier >? <typeParameters>? \ON{} <type>
6070
+ \gnewline{} \EXTENSION{} <typeIdentifier >? <typeParameters>? \ON{} <type>
6068
6071
\gnewline{} `\{' (<metadata> <classMemberDeclaration>)* `\}'
6069
6072
\end{grammar}
6070
6073
@@ -6167,8 +6170,6 @@ \section{Extensions}
6167
6170
e.g., in order to access static members of the extension,
6168
6171
or in order to resolve an invocation explicitly%
6169
6172
}).
6170
- A compile-time error occurs if the declared name of an extension
6171
- is a built-in identifier.
6172
6173
6173
6174
\LMHash{}%
6174
6175
An extension declaration introduces two scopes:
@@ -20690,11 +20691,6 @@ \subsection{Static Types}
20690
20691
it denotes an \synt{IDENTIFIER} which is not a \synt{BUILT\_IN\_IDENTIFIER}
20691
20692
(\ref{identifierReference}).%
20692
20693
}
20693
- %% TODO(eernst): The following non-terminals are currently unused (they will
20694
- %% be used when we transfer more grammar rules from Dart.g): <typeNotVoid>
20695
- %% and <typeNotVoidNotFunctionList>. They are used in the syntax for
20696
- %% \EXTENDS, \WITH, \IMPLEMENTS{} syntax and for mixin applications
20697
- %% in Dart.g, and it seems likely that we will use them here as well.
20698
20694
20699
20695
\commentary{%
20700
20696
Non-terminals with names of the form \synt{\ldots{}NotFunction}
@@ -20710,13 +20706,13 @@ \subsection{Static Types}
20710
20706
\alt <typeNotFunction>
20711
20707
20712
20708
<typeNotVoid> ::= <functionType> `?'?
20713
- \alt <typeNotVoidNotFunction>
20709
+ \alt <typeNotVoidNotFunction> `?'?
20714
20710
20715
20711
<typeNotFunction> ::= \VOID{}
20716
- \alt <typeNotVoidNotFunction>
20712
+ \alt <typeNotVoidNotFunction> `?'?
20717
20713
20718
- <typeNotVoidNotFunction> ::= <typeName> <typeArguments>? `?'?
20719
- \alt \FUNCTION{} `?'?
20714
+ <typeNotVoidNotFunction> ::= <typeName> <typeArguments>?
20715
+ \alt \FUNCTION{}
20720
20716
20721
20717
<typeName> ::= <typeIdentifier> (`.' <typeIdentifier>)?
20722
20718
0 commit comments