Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: pkg/compiler/lib/src/parser/parser.dart

Issue 2567943003: Remove support for mixin typedefs in dart2js. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/parser/parser.dart
diff --git a/pkg/compiler/lib/src/parser/parser.dart b/pkg/compiler/lib/src/parser/parser.dart
index 7ed43279cbd1588d67ba13766e03f0b1e695ba1e..988cbf32c63d165be72ac4250dba5fc1b794c509 100644
--- a/pkg/compiler/lib/src/parser/parser.dart
+++ b/pkg/compiler/lib/src/parser/parser.dart
@@ -362,30 +362,12 @@ class Parser {
Token parseTypedef(Token token) {
Token typedefKeyword = token;
- if (optional('=', peekAfterType(token.next))) {
- // TODO(aprelev@gmail.com): Remove deprecated 'typedef' mixin application,
- // remove corresponding diagnostic from members.dart.
- listener.beginNamedMixinApplication(token);
- token = parseIdentifier(token.next);
- token = parseTypeVariablesOpt(token);
- token = expect('=', token);
- token = parseModifiers(token);
- token = parseMixinApplication(token);
- Token implementsKeyword = null;
- if (optional('implements', token)) {
- implementsKeyword = token;
- token = parseTypeList(token.next);
- }
- listener.endNamedMixinApplication(
- typedefKeyword, implementsKeyword, token);
- } else {
- listener.beginFunctionTypeAlias(token);
- token = parseReturnTypeOpt(token.next);
- token = parseIdentifier(token);
- token = parseTypeVariablesOpt(token);
- token = parseFormalParameters(token);
- listener.endFunctionTypeAlias(typedefKeyword, token);
- }
+ listener.beginFunctionTypeAlias(token);
+ token = parseReturnTypeOpt(token.next);
+ token = parseIdentifier(token);
+ token = parseTypeVariablesOpt(token);
+ token = parseFormalParameters(token);
+ listener.endFunctionTypeAlias(typedefKeyword, token);
return expect(';', token);
}
@@ -682,17 +664,10 @@ class Parser {
var isMixinApplication = optional('=', peekAfterType(token.next));
if (isMixinApplication) {
listener.beginNamedMixinApplication(begin);
- token = parseIdentifier(token.next);
- token = parseTypeVariablesOpt(token);
- token = expect('=', token);
} else {
listener.beginClassDeclaration(begin);
}
- // TODO(aprelev@gmail.com): Once 'typedef' named mixin application is
- // removed, move modifiers for named mixin application to the bottom of
- // listener stack. This is so stacks for class declaration and named
- // mixin application look similar.
int modifierCount = 0;
if (abstractKeyword != null) {
parseModifier(abstractKeyword);
@@ -701,6 +676,9 @@ class Parser {
listener.handleModifiers(modifierCount);
if (isMixinApplication) {
+ token = parseIdentifier(token.next);
+ token = parseTypeVariablesOpt(token);
+ token = expect('=', token);
return parseNamedMixinApplication(token, classKeyword);
} else {
return parseClass(begin, classKeyword);
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/compiler/lib/src/resolution/class_hierarchy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698