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

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

Issue 27524003: Generate tear-off closures dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 part of scanner; 5 part of scanner;
6 6
7 class FormalParameterType { 7 class FormalParameterType {
8 final String type; 8 final String type;
9 const FormalParameterType(this.type); 9 const FormalParameterType(this.type);
10 bool get isRequired => this == REQUIRED; 10 bool get isRequired => this == REQUIRED;
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 } else { 1771 } else {
1772 bool old = mayParseFunctionExpressions; 1772 bool old = mayParseFunctionExpressions;
1773 mayParseFunctionExpressions = true; 1773 mayParseFunctionExpressions = true;
1774 token = parseParenthesizedExpression(token); 1774 token = parseParenthesizedExpression(token);
1775 mayParseFunctionExpressions = old; 1775 mayParseFunctionExpressions = old;
1776 return token; 1776 return token;
1777 } 1777 }
1778 } 1778 }
1779 1779
1780 Token parseParenthesizedExpression(Token token) { 1780 Token parseParenthesizedExpression(Token token) {
1781 var begin = (token as BeginGroupToken); 1781 var begin = token;
kasperl 2013/11/29 10:10:55 var -> BeginGroupToken?
ahe 2013/12/06 15:57:53 That breaks the code. We don't know that token is
1782 token = expect('(', token); 1782 token = expect('(', token);
1783 token = parseExpression(token); 1783 token = parseExpression(token);
1784 if (!identical(begin.endGroup, token)) { 1784 if (!identical(begin.endGroup, token)) {
1785 listener.unexpected(token); 1785 listener.unexpected(token);
1786 token = begin.endGroup; 1786 token = begin.endGroup;
1787 } 1787 }
1788 listener.handleParenthesizedExpression(begin); 1788 listener.handleParenthesizedExpression(begin);
1789 return expect(')', token); 1789 return expect(')', token);
1790 } 1790 }
1791 1791
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 } 2433 }
2434 listener.handleContinueStatement(hasTarget, continueKeyword, token); 2434 listener.handleContinueStatement(hasTarget, continueKeyword, token);
2435 return expectSemicolon(token); 2435 return expectSemicolon(token);
2436 } 2436 }
2437 2437
2438 Token parseEmptyStatement(Token token) { 2438 Token parseEmptyStatement(Token token) {
2439 listener.handleEmptyStatement(token); 2439 listener.handleEmptyStatement(token);
2440 return expectSemicolon(token); 2440 return expectSemicolon(token);
2441 } 2441 }
2442 } 2442 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698