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

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

Issue 10568011: Allow built-in identifiers for labels. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } else if (value === 'try') { 767 } else if (value === 'try') {
768 return parseTryStatement(token); 768 return parseTryStatement(token);
769 } else if (value === 'switch') { 769 } else if (value === 'switch') {
770 return parseSwitchStatement(token); 770 return parseSwitchStatement(token);
771 } else if (value === 'break') { 771 } else if (value === 'break') {
772 return parseBreakStatement(token); 772 return parseBreakStatement(token);
773 } else if (value === 'continue') { 773 } else if (value === 'continue') {
774 return parseContinueStatement(token); 774 return parseContinueStatement(token);
775 } else if (value === ';') { 775 } else if (value === ';') {
776 return parseEmptyStatement(token); 776 return parseEmptyStatement(token);
777 } else if (isIdentifier(token)) {
778 return parseExpressionStatementOrDeclaration(token);
777 } else { 779 } else {
778 return parseExpressionStatement(token); 780 return parseExpressionStatement(token);
779 } 781 }
780 } 782 }
781 783
782 Token parseReturnStatement(Token token) { 784 Token parseReturnStatement(Token token) {
783 Token begin = token; 785 Token begin = token;
784 listener.beginReturnStatement(begin); 786 listener.beginReturnStatement(begin);
785 assert('return' === token.stringValue); 787 assert('return' === token.stringValue);
786 token = token.next; 788 token = token.next;
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 } 1672 }
1671 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1673 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1672 return expectSemicolon(token); 1674 return expectSemicolon(token);
1673 } 1675 }
1674 1676
1675 Token parseEmptyStatement(Token token) { 1677 Token parseEmptyStatement(Token token) {
1676 listener.handleEmptyStatement(token); 1678 listener.handleEmptyStatement(token);
1677 return expectSemicolon(token); 1679 return expectSemicolon(token);
1678 } 1680 }
1679 } 1681 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698