| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 listener.handleNoType(token); | 315 listener.handleNoType(token); |
| 316 return token; | 316 return token; |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool isValidTypeReference(Token token) { | 319 bool isValidTypeReference(Token token) { |
| 320 final kind = token.kind; | 320 final kind = token.kind; |
| 321 if (kind === IDENTIFIER_TOKEN) return true; | 321 if (kind === IDENTIFIER_TOKEN) return true; |
| 322 if (kind === KEYWORD_TOKEN) { | 322 if (kind === KEYWORD_TOKEN) { |
| 323 Keyword keyword = token.value; | 323 Keyword keyword = token.value; |
| 324 String value = keyword.stringValue; | 324 String value = keyword.stringValue; |
| 325 return keyword.isPseudo || (value === 'Dynamic') || (value === 'void'); | 325 // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support. |
| 326 return keyword.isPseudo |
| 327 || (value === 'dynamic') |
| 328 || (value === 'Dynamic') |
| 329 || (value === 'void'); |
| 326 } | 330 } |
| 327 return false; | 331 return false; |
| 328 } | 332 } |
| 329 | 333 |
| 330 Token parseDefaultClauseOpt(Token token) { | 334 Token parseDefaultClauseOpt(Token token) { |
| 331 if (isDefaultKeyword(token)) { | 335 if (isDefaultKeyword(token)) { |
| 332 // TODO(ahe): Remove support for 'factory' in this position. | 336 // TODO(ahe): Remove support for 'factory' in this position. |
| 333 Token defaultKeyword = token; | 337 Token defaultKeyword = token; |
| 334 listener.beginDefaultClause(defaultKeyword); | 338 listener.beginDefaultClause(defaultKeyword); |
| 335 token = parseIdentifier(token.next); | 339 token = parseIdentifier(token.next); |
| (...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2045 } | 2049 } |
| 2046 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 2050 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 2047 return expectSemicolon(token); | 2051 return expectSemicolon(token); |
| 2048 } | 2052 } |
| 2049 | 2053 |
| 2050 Token parseEmptyStatement(Token token) { | 2054 Token parseEmptyStatement(Token token) { |
| 2051 listener.handleEmptyStatement(token); | 2055 listener.handleEmptyStatement(token); |
| 2052 return expectSemicolon(token); | 2056 return expectSemicolon(token); |
| 2053 } | 2057 } |
| 2054 } | 2058 } |
| OLD | NEW |