Skip to content

Commit 20f197d

Browse files
eernstgCommit Queue
authored andcommitted
Include the most recent updates on type modifiers in Dart.g
The class modifiers feature specification was updated such that mixins cannot be `sealed`, and several other combinations were eliminated. This CL makes those changes to Dart.g. The changes have been in effect for a while (8 months since last update to the spec), but the update to Dart.g was somehow not performed at the time. This CL fixes that omission. Change-Id: Ifd2124583a124cdaaa7822f94f70e707ec33b425 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358460 Reviewed-by: William Hesse <[email protected]> Commit-Queue: Erik Ernst <[email protected]>
1 parent f30a7ad commit 20f197d

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

tools/spec_parser/Dart.g

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// CHANGES:
66
//
7+
// v0.39 Include latest changes to mixin related class modifiers.
8+
//
79
// v0.38 Broaden `initializerExpression` to match implemented behavior.
810
//
911
// v0.37 Correct `libraryExport` to use `configurableUri`, not `uri`.
@@ -392,7 +394,7 @@ classDeclaration
392394
: (classModifiers | mixinClassModifiers)
393395
CLASS typeWithParameters superclass? interfaces?
394396
LBRACE (metadata classMemberDeclaration)* RBRACE
395-
| classModifiers CLASS mixinApplicationClass
397+
| classModifiers MIXIN? CLASS mixinApplicationClass
396398
;
397399
398400
classModifiers
@@ -427,18 +429,11 @@ mixinApplicationClass
427429
;
428430
429431
mixinDeclaration
430-
: mixinModifier? MIXIN typeIdentifier typeParameters?
432+
: BASE? MIXIN typeIdentifier typeParameters?
431433
(ON typeNotVoidNotFunctionList)? interfaces?
432434
LBRACE (metadata mixinMemberDeclaration)* RBRACE
433435
;
434436
435-
mixinModifier
436-
: SEALED
437-
| BASE
438-
| INTERFACE
439-
| FINAL
440-
;
441-
442437
// TODO: We might want to make this more strict.
443438
mixinMemberDeclaration
444439
: classMemberDeclaration

tools/spec_parser/dart_spec_parser/Dart.g4

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
// CHANGES:
6+
//
7+
// v0.40 Include latest changes to mixin related class modifiers.
8+
//
69
// v0.39 Translate actions from Java to Dart.
710
//
811
// v0.38 Broaden `initializerExpression` to match implemented behavior.
@@ -397,7 +400,7 @@ classDeclaration
397400
: (classModifiers | mixinClassModifiers)
398401
CLASS typeWithParameters superclass? interfaces?
399402
LBRACE (metadata classMemberDeclaration)* RBRACE
400-
| classModifiers CLASS mixinApplicationClass
403+
| classModifiers MIXIN? CLASS mixinApplicationClass
401404
;
402405

403406
classModifiers
@@ -432,18 +435,11 @@ mixinApplicationClass
432435
;
433436

434437
mixinDeclaration
435-
: mixinModifier? MIXIN typeIdentifier typeParameters?
438+
: BASE? MIXIN typeIdentifier typeParameters?
436439
(ON typeNotVoidNotFunctionList)? interfaces?
437440
LBRACE (metadata mixinMemberDeclaration)* RBRACE
438441
;
439442

440-
mixinModifier
441-
: SEALED
442-
| BASE
443-
| INTERFACE
444-
| FINAL
445-
;
446-
447443
// TODO: We might want to make this more strict.
448444
mixinMemberDeclaration
449445
: classMemberDeclaration

0 commit comments

Comments
 (0)