Skip to content

Commit

Permalink
Update the grammar to prevent an extension from having the name type (
Browse files Browse the repository at this point in the history
  • Loading branch information
eernstg authored Oct 31, 2023
1 parent c214fd9 commit 8a4003d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
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

0 comments on commit 8a4003d

Please sign in to comment.