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

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

Issue 10990108: Handle modifiers (abstract) on class nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: TODO added Created 8 years, 2 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 /** 5 /**
6 * An event generating parser of Dart programs. This parser expects 6 * An event generating parser of Dart programs. This parser expects
7 * all tokens in a linked list (aka a token stream). 7 * all tokens in a linked list (aka a token stream).
8 * 8 *
9 * The class [Scanner] is used to generate a token stream. See the 9 * The class [Scanner] is used to generate a token stream. See the
10 * file scanner.dart. 10 * file scanner.dart.
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 return listener.unmatched(beginGroupToken); 422 return listener.unmatched(beginGroupToken);
423 } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) { 423 } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) {
424 return listener.unmatched(beginGroupToken); 424 return listener.unmatched(beginGroupToken);
425 } 425 }
426 return beginGroupToken.endGroup; 426 return beginGroupToken.endGroup;
427 } 427 }
428 428
429 Token parseClass(Token token) { 429 Token parseClass(Token token) {
430 Token begin = token; 430 Token begin = token;
431 listener.beginClassDeclaration(token); 431 listener.beginClassDeclaration(token);
432 int modifierCount = 0;
432 if (optional('abstract', token)) { 433 if (optional('abstract', token)) {
433 // TODO(ahe): Notify listener about abstract modifier. 434 listener.handleModifier(token);
435 modifierCount++;
434 token = token.next; 436 token = token.next;
435 } 437 }
438 listener.handleModifiers(modifierCount);
436 token = parseIdentifier(token.next); 439 token = parseIdentifier(token.next);
437 token = parseTypeVariablesOpt(token); 440 token = parseTypeVariablesOpt(token);
438 Token extendsKeyword; 441 Token extendsKeyword;
439 if (optional('extends', token)) { 442 if (optional('extends', token)) {
440 extendsKeyword = token; 443 extendsKeyword = token;
441 token = parseType(token.next); 444 token = parseType(token.next);
442 } else { 445 } else {
443 extendsKeyword = null; 446 extendsKeyword = null;
444 listener.handleNoType(token); 447 listener.handleNoType(token);
445 } 448 }
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 } 2137 }
2135 listener.handleContinueStatement(hasTarget, continueKeyword, token); 2138 listener.handleContinueStatement(hasTarget, continueKeyword, token);
2136 return expectSemicolon(token); 2139 return expectSemicolon(token);
2137 } 2140 }
2138 2141
2139 Token parseEmptyStatement(Token token) { 2142 Token parseEmptyStatement(Token token) {
2140 listener.handleEmptyStatement(token); 2143 listener.handleEmptyStatement(token);
2141 return expectSemicolon(token); 2144 return expectSemicolon(token);
2142 } 2145 }
2143 } 2146 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698