| 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 part of scanner; | 5 part of scanner; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * An event generating parser of Dart programs. This parser expects | 8 * An event generating parser of Dart programs. This parser expects |
| 9 * all tokens in a linked list (aka a token stream). | 9 * all tokens in a linked list (aka a token stream). |
| 10 * | 10 * |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 } else { | 1533 } else { |
| 1534 bool old = mayParseFunctionExpressions; | 1534 bool old = mayParseFunctionExpressions; |
| 1535 mayParseFunctionExpressions = true; | 1535 mayParseFunctionExpressions = true; |
| 1536 token = parseParenthesizedExpression(token); | 1536 token = parseParenthesizedExpression(token); |
| 1537 mayParseFunctionExpressions = old; | 1537 mayParseFunctionExpressions = old; |
| 1538 return token; | 1538 return token; |
| 1539 } | 1539 } |
| 1540 } | 1540 } |
| 1541 | 1541 |
| 1542 Token parseParenthesizedExpression(Token token) { | 1542 Token parseParenthesizedExpression(Token token) { |
| 1543 BeginGroupToken begin = token; | 1543 var begin = token; |
| 1544 token = expect('(', token); | 1544 token = expect('(', token); |
| 1545 token = parseExpression(token); | 1545 token = parseExpression(token); |
| 1546 if (!identical(begin.endGroup, token)) { | 1546 if (!identical(begin.endGroup, token)) { |
| 1547 listener.unexpected(token); | 1547 listener.unexpected(token); |
| 1548 token = begin.endGroup; | 1548 token = begin.endGroup; |
| 1549 } | 1549 } |
| 1550 listener.handleParenthesizedExpression(begin); | 1550 listener.handleParenthesizedExpression(begin); |
| 1551 return expect(')', token); | 1551 return expect(')', token); |
| 1552 } | 1552 } |
| 1553 | 1553 |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 } | 2162 } |
| 2163 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 2163 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 2164 return expectSemicolon(token); | 2164 return expectSemicolon(token); |
| 2165 } | 2165 } |
| 2166 | 2166 |
| 2167 Token parseEmptyStatement(Token token) { | 2167 Token parseEmptyStatement(Token token) { |
| 2168 listener.handleEmptyStatement(token); | 2168 listener.handleEmptyStatement(token); |
| 2169 return expectSemicolon(token); | 2169 return expectSemicolon(token); |
| 2170 } | 2170 } |
| 2171 } | 2171 } |
| OLD | NEW |