mirror of
https://github.com/dart-lang/sdk
synced 2024-07-25 04:15:45 +00:00
Update Dart.g
Update Dart.g to handle symbolLiterals, define builtInIdentifier non-terminal, enable non-function type aliases, delete obsolete comments. Add `metadata` to n{ormal,amed}ParameterType; add `extension` to identifierNotFunction. Change-Id: I130be575265732dcd9ad7708460b2a4326e765c3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195501 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
This commit is contained in:
parent
0a5525fdb1
commit
bb5cb79a2f
|
@ -360,23 +360,6 @@ methodSignature
|
|||
| constructorSignature
|
||||
;
|
||||
|
||||
// https://github.com/dart-lang/sdk/issues/29501 reports on the problem which
|
||||
// was solved by adding a case for redirectingFactoryConstructorSignature.
|
||||
// TODO(eernst): Close that issue when this is integrated into the spec.
|
||||
|
||||
// https://github.com/dart-lang/sdk/issues/29502 reports on the problem that
|
||||
// than external const factory constructor declaration cannot be derived by
|
||||
// the spec grammar (and also not by this grammar). The following fixes were
|
||||
// introduced for that: Added the 'factoryConstructorSignature' case below in
|
||||
// 'declaration'; also added 'CONST?' in the 'factoryConstructorSignature'
|
||||
// rule, such that const factories in general are allowed.
|
||||
// TODO(eernst): Close that issue when this is integrated into the spec.
|
||||
|
||||
// TODO(eernst): Note that `EXTERNAL? STATIC? functionSignature` includes
|
||||
// `STATIC functionSignature`, but a static function cannot be abstract.
|
||||
// We might want to make that a syntax error rather than a static semantic
|
||||
// check.
|
||||
|
||||
declaration
|
||||
: EXTERNAL factoryConstructorSignature
|
||||
| EXTERNAL constantConstructorSignature
|
||||
|
@ -901,27 +884,7 @@ assignableSelector
|
|||
|
||||
identifierNotFUNCTION
|
||||
: IDENTIFIER
|
||||
| ABSTRACT // Built-in identifier.
|
||||
| AS // Built-in identifier.
|
||||
| COVARIANT // Built-in identifier.
|
||||
| DEFERRED // Built-in identifier.
|
||||
| DYNAMIC // Built-in identifier.
|
||||
| EXPORT // Built-in identifier.
|
||||
| EXTERNAL // Built-in identifier.
|
||||
| FACTORY // Built-in identifier.
|
||||
| GET // Built-in identifier.
|
||||
| IMPLEMENTS // Built-in identifier.
|
||||
| IMPORT // Built-in identifier.
|
||||
| INTERFACE // Built-in identifier.
|
||||
| LATE // Built-in identifier.
|
||||
| LIBRARY // Built-in identifier.
|
||||
| MIXIN // Built-in identifier.
|
||||
| OPERATOR // Built-in identifier.
|
||||
| PART // Built-in identifier.
|
||||
| REQUIRED // Built-in identifier.
|
||||
| SET // Built-in identifier.
|
||||
| STATIC // Built-in identifier.
|
||||
| TYPEDEF // Built-in identifier.
|
||||
| builtInIdentifier
|
||||
| ASYNC // Not a built-in identifier.
|
||||
| HIDE // Not a built-in identifier.
|
||||
| OF // Not a built-in identifier.
|
||||
|
@ -1219,7 +1182,7 @@ typeNotVoidNotFunctionList
|
|||
;
|
||||
|
||||
typeAlias
|
||||
: TYPEDEF typeIdentifier typeParameters? '=' functionType ';'
|
||||
: TYPEDEF typeIdentifier typeParameters? '=' type ';'
|
||||
| TYPEDEF functionTypeAlias
|
||||
;
|
||||
|
||||
|
@ -1258,8 +1221,8 @@ normalParameterTypes
|
|||
;
|
||||
|
||||
normalParameterType
|
||||
: typedIdentifier
|
||||
| type
|
||||
: metadata typedIdentifier
|
||||
| metadata type
|
||||
;
|
||||
|
||||
optionalParameterTypes
|
||||
|
@ -1276,7 +1239,7 @@ namedParameterTypes
|
|||
;
|
||||
|
||||
namedParameterType
|
||||
: REQUIRED? typedIdentifier
|
||||
: metadata REQUIRED? typedIdentifier
|
||||
;
|
||||
|
||||
typedIdentifier
|
||||
|
@ -1290,7 +1253,7 @@ constructorDesignation
|
|||
;
|
||||
|
||||
symbolLiteral
|
||||
: '#' (operator | (identifier ('.' identifier)*))
|
||||
: '#' (operator | (identifier ('.' identifier)*) | VOID)
|
||||
;
|
||||
|
||||
// Not used in the specification (needed here for <uri>).
|
||||
|
@ -1324,6 +1287,68 @@ multiLineString
|
|||
MULTI_LINE_STRING_DQ_MID_END
|
||||
;
|
||||
|
||||
reservedWord
|
||||
: ASSERT
|
||||
| BREAK
|
||||
| CASE
|
||||
| CATCH
|
||||
| CLASS
|
||||
| CONST
|
||||
| CONTINUE
|
||||
| DEFAULT
|
||||
| DO
|
||||
| ELSE
|
||||
| ENUM
|
||||
| EXTENDS
|
||||
| FALSE
|
||||
| FINAL
|
||||
| FINALLY
|
||||
| FOR
|
||||
| IF
|
||||
| IN
|
||||
| IS
|
||||
| NEW
|
||||
| NULL
|
||||
| RETHROW
|
||||
| RETURN
|
||||
| SUPER
|
||||
| SWITCH
|
||||
| THIS
|
||||
| THROW
|
||||
| TRUE
|
||||
| TRY
|
||||
| VAR
|
||||
| VOID
|
||||
| WHILE
|
||||
| WITH
|
||||
;
|
||||
|
||||
builtInIdentifier
|
||||
: ABSTRACT
|
||||
| AS
|
||||
| COVARIANT
|
||||
| DEFERRED
|
||||
| DYNAMIC
|
||||
| EXPORT
|
||||
| EXTENSION
|
||||
| EXTERNAL
|
||||
| FACTORY
|
||||
| FUNCTION
|
||||
| GET
|
||||
| IMPLEMENTS
|
||||
| IMPORT
|
||||
| INTERFACE
|
||||
| LATE
|
||||
| LIBRARY
|
||||
| OPERATOR
|
||||
| MIXIN
|
||||
| PART
|
||||
| REQUIRED
|
||||
| SET
|
||||
| STATIC
|
||||
| TYPEDEF
|
||||
;
|
||||
|
||||
// ---------------------------------------- Lexer rules.
|
||||
|
||||
fragment
|
||||
|
|
Loading…
Reference in a new issue