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

Unified Diff: sdk/lib/_internal/compiler/implementation/scanner/parser.dart

Issue 11953048: Support 'implements' clause on typedef mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 7 years, 11 months 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: sdk/lib/_internal/compiler/implementation/scanner/parser.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
index 91aa70be1edb080292ed7ddb825dbd7bfe44272c..06ef26596c3e78c2898447adfd11f855e41ad3cb 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
@@ -266,8 +266,15 @@ class Parser {
token = parseIdentifier(token.next);
token = parseTypeVariablesOpt(token);
token = expect('=', token);
- token = parseMixinApplication(token, true);
- listener.endNamedMixinApplication(typedefKeyword, 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);
@@ -279,13 +286,8 @@ class Parser {
return expect(';', token);
}
- Token parseMixinApplication(Token token, bool isTypedef) {
Johnni Winther 2013/01/24 08:33:18 Good to get rid of this :)
+ Token parseMixinApplication(Token token) {
listener.beginMixinApplication(token);
- if (isTypedef) {
- token = parseModifiers(token);
- } else {
- listener.handleModifiers(0);
- }
token = parseType(token);
token = expect('with', token);
token = parseTypeList(token);
@@ -489,7 +491,7 @@ class Parser {
if (optional('extends', token)) {
extendsKeyword = token;
if (optional('with', token.next.next)) {
- token = parseMixinApplication(token.next, false);
+ token = parseMixinApplication(token.next);
} else {
token = parseType(token.next);
}

Powered by Google App Engine
This is Rietveld 408576698