| OLD | NEW |
| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 return listener.unmatched(beginGroupToken); | 378 return listener.unmatched(beginGroupToken); |
| 379 } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) { | 379 } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) { |
| 380 return listener.unmatched(beginGroupToken); | 380 return listener.unmatched(beginGroupToken); |
| 381 } | 381 } |
| 382 return beginGroupToken.endGroup; | 382 return beginGroupToken.endGroup; |
| 383 } | 383 } |
| 384 | 384 |
| 385 Token parseClass(Token token) { | 385 Token parseClass(Token token) { |
| 386 Token begin = token; | 386 Token begin = token; |
| 387 listener.beginClassDeclaration(token); | 387 listener.beginClassDeclaration(token); |
| 388 int modifierCount = 0; |
| 388 if (optional('abstract', token)) { | 389 if (optional('abstract', token)) { |
| 389 // TODO(ahe): Notify listener about abstract modifier. | 390 listener.handleModifier(token); |
| 391 modifierCount++; |
| 390 token = token.next; | 392 token = token.next; |
| 391 } | 393 } |
| 394 listener.handleModifiers(modifierCount); |
| 392 token = parseIdentifier(token.next); | 395 token = parseIdentifier(token.next); |
| 393 token = parseTypeVariablesOpt(token); | 396 token = parseTypeVariablesOpt(token); |
| 394 Token extendsKeyword; | 397 Token extendsKeyword; |
| 395 if (optional('extends', token)) { | 398 if (optional('extends', token)) { |
| 396 extendsKeyword = token; | 399 extendsKeyword = token; |
| 397 token = parseType(token.next); | 400 token = parseType(token.next); |
| 398 } else { | 401 } else { |
| 399 extendsKeyword = null; | 402 extendsKeyword = null; |
| 400 listener.handleNoType(token); | 403 listener.handleNoType(token); |
| 401 } | 404 } |
| (...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2045 } | 2048 } |
| 2046 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 2049 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 2047 return expectSemicolon(token); | 2050 return expectSemicolon(token); |
| 2048 } | 2051 } |
| 2049 | 2052 |
| 2050 Token parseEmptyStatement(Token token) { | 2053 Token parseEmptyStatement(Token token) { |
| 2051 listener.handleEmptyStatement(token); | 2054 listener.handleEmptyStatement(token); |
| 2052 return expectSemicolon(token); | 2055 return expectSemicolon(token); |
| 2053 } | 2056 } |
| 2054 } | 2057 } |
| OLD | NEW |