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

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

Issue 12018014: Start allowing mixin application extensions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Extend test cases. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of scanner; 5 part of scanner;
6 6
7 /** 7 /**
8 * An event generating parser of Dart programs. This parser expects 8 * An event generating parser of Dart programs. This parser expects
9 * all tokens in a linked list (aka a token stream). 9 * all tokens in a linked list (aka a token stream).
10 * 10 *
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 listener.handleModifier(token); 477 listener.handleModifier(token);
478 modifierCount++; 478 modifierCount++;
479 token = token.next; 479 token = token.next;
480 } 480 }
481 listener.handleModifiers(modifierCount); 481 listener.handleModifiers(modifierCount);
482 token = parseIdentifier(token.next); 482 token = parseIdentifier(token.next);
483 token = parseTypeVariablesOpt(token); 483 token = parseTypeVariablesOpt(token);
484 Token extendsKeyword; 484 Token extendsKeyword;
485 if (optional('extends', token)) { 485 if (optional('extends', token)) {
486 extendsKeyword = token; 486 extendsKeyword = token;
487 token = parseType(token.next); 487 if (optional('with', token.next.next)) {
488 // TODO(kasperl): Disallow modifiers here.
489 token = parseMixinApplication(token.next);
490 } else {
491 token = parseType(token.next);
492 }
488 } else { 493 } else {
489 extendsKeyword = null; 494 extendsKeyword = null;
490 listener.handleNoType(token); 495 listener.handleNoType(token);
491 } 496 }
492 Token implementsKeyword; 497 Token implementsKeyword;
493 int interfacesCount = 0; 498 int interfacesCount = 0;
494 if (optional('implements', token)) { 499 if (optional('implements', token)) {
495 implementsKeyword = token; 500 implementsKeyword = token;
496 do { 501 do {
497 token = parseType(token.next); 502 token = parseType(token.next);
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
2187 } 2192 }
2188 listener.handleContinueStatement(hasTarget, continueKeyword, token); 2193 listener.handleContinueStatement(hasTarget, continueKeyword, token);
2189 return expectSemicolon(token); 2194 return expectSemicolon(token);
2190 } 2195 }
2191 2196
2192 Token parseEmptyStatement(Token token) { 2197 Token parseEmptyStatement(Token token) {
2193 listener.handleEmptyStatement(token); 2198 listener.handleEmptyStatement(token);
2194 return expectSemicolon(token); 2199 return expectSemicolon(token);
2195 } 2200 }
2196 } 2201 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698