Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the grammar to prevent an extension from having the name type #3431

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions specification/dart.sty
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
\def\THROW{\keyword{throw}}
\def\TRUE{\keyword{true}}
\def\TRY{\keyword{try}}
\def\TYPE{\keyword{type}}
\def\VAR{\keyword{var}}
\def\VOID{\keyword{void}}
\def\WHILE{\keyword{while}}
Expand Down
21 changes: 16 additions & 5 deletions specification/dartLangSpec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
% version of the language which will actually be specified by the next stable
% release of this document.
%
% Oct 2023
% - Introduce the rule that an `extension` declaration cannot have the name
% `type`. This is needed in order to disambiguate an `extension type`
% named `on`.
%
% Aug 2023
% - Correct text about built-in identifier error and turn it into commentary
% (the normative text is in grammar rules using `typeIdentifier`), and
Expand Down Expand Up @@ -6083,8 +6088,8 @@ \section{Extensions}
and whether the invocation satisfies several other requirements.

\begin{grammar}
<extensionDeclaration> ::=
\gnewline{} \EXTENSION{} <typeIdentifier>? <typeParameters>? \ON{} <type>
<extensionDeclaration> ::= \gnewline{}
\EXTENSION{} <typeIdentifierNotType>? <typeParameters>? \ON{} <type>
\gnewline{} `\{' (<metadata> <classMemberDeclaration>)* `\}'
\end{grammar}

Expand Down Expand Up @@ -17154,10 +17159,13 @@ \subsection{Identifier Reference}
\alt <BUILT\_IN\_IDENTIFIER>
\alt <OTHER\_IDENTIFIER>

<typeIdentifier> ::= <IDENTIFIER>
\alt <OTHER\_IDENTIFIER>
<typeIdentifierNotType> ::= <IDENTIFIER>
\alt <OTHER\_IDENTIFIER\_NOT\_TYPE>
\alt \DYNAMIC{}

<typeIdentifier> ::= <typeIdentifierNotType>
\alt \TYPE{}

<qualifiedName> ::= <typeIdentifier> `.' <identifier>
\alt <typeIdentifier> `.' <typeIdentifier> `.' <identifier>

Expand All @@ -17168,10 +17176,13 @@ \subsection{Identifier Reference}
\LIBRARY{} | \MIXIN{} | \OPERATOR{}
\alt\hspace{-3mm} \PART{} | \REQUIRED{} | \SET{} | \STATIC{} | \TYPEDEF{}

<OTHER\_IDENTIFIER> ::= \gnewline{}
<OTHER\_IDENTIFIER\_NOT\_TYPE> ::= \gnewline{}
\ASYNC{} | \HIDE{} | \OF{} | \ON{} | \SHOW{} | \SYNC{} |
\AWAIT{} | \YIELD{}

<OTHER\_IDENTIFIER> ::= \gnewline{}
<OTHER\_IDENTIFIER\_NOT\_TYPE> | \TYPE{}

<IDENTIFIER\_NO\_DOLLAR> ::= <IDENTIFIER\_START\_NO\_DOLLAR>
\gnewline{} <IDENTIFIER\_PART\_NO\_DOLLAR>*

Expand Down