Skip to content

Commit

Permalink
Update the specification parser to follow language repo #4016
Browse files Browse the repository at this point in the history
The PR dart-lang/language#4016 updates the
augmentation feature specification such that augmenting extension type
declarations do not specify the primary constructor. This CL changes
Dart.g (and hence the specification parser) accordingly.

It also corrects a typo in Dart.g.

Change-Id: I10b49873a96524a9d363f842b39688f3c624b9f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379100
Reviewed-by: Chloe Stefantsova <[email protected]>
Commit-Queue: Erik Ernst <[email protected]>
  • Loading branch information
eernstg authored and Commit Queue committed Aug 7, 2024
1 parent ed3167f commit f019c81
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
11 changes: 8 additions & 3 deletions tools/spec_parser/Dart.g
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// CHANGES:
//
// v0.45 Update rule about augmenting extension type declaration to omit
// the primary constructor.
//
// v0.44 Support null-aware elements.
//
// v0.43 Change rule structure such that the association of metadata
Expand Down Expand Up @@ -453,9 +456,11 @@ mixinMemberDeclaration
;
extensionTypeDeclaration
: AUGMENT? EXTENSION TYPE CONST? typeWithParameters
: EXTENSION TYPE CONST? typeWithParameters
representationDeclaration interfaces?
LBRACE (metadata extensionTypeMemberDeclaration)* RBRACE
| AUGMENT EXTENSION TYPE typeWithParameters interfaces?
LBRACE (metadata extensionTypeMemberDeclaration)* RBRACE
;
representationDeclaration
Expand Down Expand Up @@ -607,7 +612,7 @@ mixinApplication
;
enumType
: AUGMENT? ENUM typeWithParameters? mixins? interfaces? LBRACE
: AUGMENT? ENUM typeWithParameters mixins? interfaces? LBRACE
enumEntry (',' enumEntry)* (',')?
(';' (metadata classMemberDeclaration)*)?
RBRACE
Expand Down Expand Up @@ -1532,7 +1537,7 @@ typeNotVoidNotFunctionList
;
typeAlias
: AUGMENT? TYPEDEF typeIdentifier typeParameters? '=' type ';'
: AUGMENT? TYPEDEF typeWithParameters '=' type ';'
| AUGMENT? TYPEDEF functionTypeAlias
;
Expand Down
13 changes: 6 additions & 7 deletions tools/spec_parser/dart_spec_parser/Dart.g4
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

// CHANGES:
//
// v0.44 Change rule structure such that the association of metadata
// with non-terminals can be explained in a simple and consistent way.
// The derivable terms do not change. Remove `metadata` from the kind
// of `forLoopParts` where the iteration variable is an existing variable
// in scope (this is not implemented, is inconsistent anyway).
// v0.46 Update rule about augmenting extension type declaration to omit
// the primary constructor.
//
// v0.45 Support null-aware elements.
//
Expand Down Expand Up @@ -465,9 +462,11 @@ mixinMemberDeclaration
;

extensionTypeDeclaration
: AUGMENT? EXTENSION TYPE CONST? typeWithParameters
: EXTENSION TYPE CONST? typeWithParameters
representationDeclaration interfaces?
LBRACE (metadata extensionTypeMemberDeclaration)* RBRACE
| AUGMENT EXTENSION TYPE typeWithParameters interfaces?
LBRACE (metadata extensionTypeMemberDeclaration)* RBRACE
;

representationDeclaration
Expand Down Expand Up @@ -1240,7 +1239,7 @@ outerPattern
;

outerPatternDeclarationPrefix
: (FINAL | VAR) outerPattern
: (FINAL | VAR) outerPattern
;

patternAssignment
Expand Down

0 comments on commit f019c81

Please sign in to comment.