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

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

Issue 11021008: Added 'dynamic' keyword, so that 'Dynamic' can be deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated dart2dart test status file with co19 issue as well. 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 listener.handleNoType(token); 351 listener.handleNoType(token);
352 return token; 352 return token;
353 } 353 }
354 354
355 bool isValidTypeReference(Token token) { 355 bool isValidTypeReference(Token token) {
356 final kind = token.kind; 356 final kind = token.kind;
357 if (kind === IDENTIFIER_TOKEN) return true; 357 if (kind === IDENTIFIER_TOKEN) return true;
358 if (kind === KEYWORD_TOKEN) { 358 if (kind === KEYWORD_TOKEN) {
359 Keyword keyword = token.value; 359 Keyword keyword = token.value;
360 String value = keyword.stringValue; 360 String value = keyword.stringValue;
361 return keyword.isPseudo || (value === 'Dynamic') || (value === 'void'); 361 // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support.
362 return keyword.isPseudo
363 || (value === 'dynamic')
364 || (value === 'Dynamic')
365 || (value === 'void');
362 } 366 }
363 return false; 367 return false;
364 } 368 }
365 369
366 Token parseDefaultClauseOpt(Token token) { 370 Token parseDefaultClauseOpt(Token token) {
367 if (isDefaultKeyword(token)) { 371 if (isDefaultKeyword(token)) {
368 // TODO(ahe): Remove support for 'factory' in this position. 372 // TODO(ahe): Remove support for 'factory' in this position.
369 Token defaultKeyword = token; 373 Token defaultKeyword = token;
370 listener.beginDefaultClause(defaultKeyword); 374 listener.beginDefaultClause(defaultKeyword);
371 token = parseIdentifier(token.next); 375 token = parseIdentifier(token.next);
(...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 } 2138 }
2135 listener.handleContinueStatement(hasTarget, continueKeyword, token); 2139 listener.handleContinueStatement(hasTarget, continueKeyword, token);
2136 return expectSemicolon(token); 2140 return expectSemicolon(token);
2137 } 2141 }
2138 2142
2139 Token parseEmptyStatement(Token token) { 2143 Token parseEmptyStatement(Token token) {
2140 listener.handleEmptyStatement(token); 2144 listener.handleEmptyStatement(token);
2141 return expectSemicolon(token); 2145 return expectSemicolon(token);
2142 } 2146 }
2143 } 2147 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/keyword.dart ('k') | lib/compiler/implementation/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698