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

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

Issue 11953012: Add more mixin tests and start rejecting illegal syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files. 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 2909cc9e8bbe8c63146b326acdb644364fa526e3..91aa70be1edb080292ed7ddb825dbd7bfe44272c 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
@@ -266,7 +266,7 @@ class Parser {
token = parseIdentifier(token.next);
token = parseTypeVariablesOpt(token);
token = expect('=', token);
- token = parseMixinApplication(token);
+ token = parseMixinApplication(token, true);
listener.endNamedMixinApplication(typedefKeyword, token);
} else {
listener.beginFunctionTypeAlias(token);
@@ -279,9 +279,13 @@ class Parser {
return expect(';', token);
}
- Token parseMixinApplication(Token token) {
+ Token parseMixinApplication(Token token, bool isTypedef) {
listener.beginMixinApplication(token);
- token = parseModifiers(token);
+ if (isTypedef) {
+ token = parseModifiers(token);
+ } else {
+ listener.handleModifiers(0);
ahe 2013/01/21 12:38:53 This is a hack. You should let endMixinApplication
kasperl 2013/01/21 12:46:16 Ah, okay. In that case, it's a hack used in at lea
ahe 2013/01/21 13:03:10 Yes. I'm not sure I realized it the time, but it b
kasperl 2013/01/21 13:04:46 Yeah, that is pretty nasty. I'll try to address it
+ }
token = parseType(token);
token = expect('with', token);
token = parseTypeList(token);
@@ -485,8 +489,7 @@ class Parser {
if (optional('extends', token)) {
extendsKeyword = token;
if (optional('with', token.next.next)) {
- // TODO(kasperl): Disallow modifiers here.
- token = parseMixinApplication(token.next);
+ token = parseMixinApplication(token.next, false);
} else {
token = parseType(token.next);
}

Powered by Google App Engine
This is Rietveld 408576698