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

Side by Side Diff: frog/leg/scanner/parser.dart

Issue 9863037: Generate prettier loops. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 8 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 | « frog/leg/scanner/listener.dart ('k') | frog/leg/ssa/builder.dart » ('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. 7 * all tokens in a linked list.
8 */ 8 */
9 class Parser { 9 class Parser {
10 final Listener listener; 10 final Listener listener;
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 listener.endForStatement(expressionCount, forToken, token); 1400 listener.endForStatement(expressionCount, forToken, token);
1401 return token; 1401 return token;
1402 } 1402 }
1403 1403
1404 Token parseForInRest(Token forToken, Token token) { 1404 Token parseForInRest(Token forToken, Token token) {
1405 assert(optional('in', token)); 1405 assert(optional('in', token));
1406 Token inKeyword = token; 1406 Token inKeyword = token;
1407 token = parseExpression(token.next); 1407 token = parseExpression(token.next);
1408 token = expect(')', token); 1408 token = expect(')', token);
1409 token = parseStatement(token); 1409 token = parseStatement(token);
1410 listener.endForInStatement(forToken, inKeyword, token); 1410 listener.endForIn(forToken, inKeyword, token);
1411 return token; 1411 return token;
1412 } 1412 }
1413 1413
1414 Token parseWhileStatement(Token token) { 1414 Token parseWhileStatement(Token token) {
1415 Token whileToken = token; 1415 Token whileToken = token;
1416 listener.beginWhileStatement(whileToken); 1416 listener.beginWhileStatement(whileToken);
1417 token = expect('while', token); 1417 token = expect('while', token);
1418 token = parseParenthesizedExpression(token); 1418 token = parseParenthesizedExpression(token);
1419 token = parseStatement(token); 1419 token = parseStatement(token);
1420 listener.endWhileStatement(whileToken, token); 1420 listener.endWhileStatement(whileToken, token);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 } 1583 }
1584 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1584 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1585 return expectSemicolon(token); 1585 return expectSemicolon(token);
1586 } 1586 }
1587 1587
1588 Token parseEmptyStatement(Token token) { 1588 Token parseEmptyStatement(Token token) {
1589 listener.handleEmptyStatement(token); 1589 listener.handleEmptyStatement(token);
1590 return expectSemicolon(token); 1590 return expectSemicolon(token);
1591 } 1591 }
1592 } 1592 }
OLDNEW
« no previous file with comments | « frog/leg/scanner/listener.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698