Index: pkg/front_end/lib/src/fasta/parser/parser.dart |
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart |
index 270320dd9a68f9005ec81b678990a2908138881d..7c16ef901b70b5162afb89d8704bb0fd48065530 100644 |
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart |
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart |
@@ -637,9 +637,10 @@ class Parser { |
return expect(';', token); |
} |
- Token parseMixinApplication(Token token) { |
+ /// Parse a mixin application starting from `with`. Assumes that the first |
+ /// type has already been parsed. |
+ Token parseMixinApplicationRest(Token token) { |
listener.beginMixinApplication(token); |
- token = parseType(token); |
Token withKeyword = token; |
token = expect('with', token); |
token = parseTypeList(token); |
@@ -1002,7 +1003,8 @@ class Parser { |
Token parseNamedMixinApplication( |
Token token, Token begin, Token classKeyword, Token name, Token equals) { |
- token = parseMixinApplication(token); |
+ token = parseType(token); |
+ token = parseMixinApplicationRest(token); |
Token implementsKeyword = null; |
if (optional('implements', token)) { |
implementsKeyword = token; |
@@ -1017,10 +1019,9 @@ class Parser { |
Token extendsKeyword; |
if (optional('extends', token)) { |
extendsKeyword = token; |
- if (optional('with', peekAfterNominalType(token.next))) { |
- token = parseMixinApplication(token.next); |
- } else { |
- token = parseType(token.next); |
+ token = parseType(token.next); |
+ if (optional('with', token)) { |
+ token = parseMixinApplicationRest(token); |
} |
} else { |
extendsKeyword = null; |