| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 (value === '[]') || | 1218 (value === '[]') || |
| 1219 (value === '{')) { | 1219 (value === '{')) { |
| 1220 return parseLiteralListOrMap(constKeyword); | 1220 return parseLiteralListOrMap(constKeyword); |
| 1221 } | 1221 } |
| 1222 token = parseType(token); | 1222 token = parseType(token); |
| 1223 bool named = false; | 1223 bool named = false; |
| 1224 if (optional('.', token)) { | 1224 if (optional('.', token)) { |
| 1225 named = true; | 1225 named = true; |
| 1226 token = parseIdentifier(token.next); | 1226 token = parseIdentifier(token.next); |
| 1227 } | 1227 } |
| 1228 expect('(', token); |
| 1228 token = parseArguments(token); | 1229 token = parseArguments(token); |
| 1229 listener.handleConstExpression(constKeyword, named); | 1230 listener.handleConstExpression(constKeyword, named); |
| 1230 return token; | 1231 return token; |
| 1231 } | 1232 } |
| 1232 | 1233 |
| 1233 Token parseLiteralInt(Token token) { | 1234 Token parseLiteralInt(Token token) { |
| 1234 listener.handleLiteralInt(token); | 1235 listener.handleLiteralInt(token); |
| 1235 return token.next; | 1236 return token.next; |
| 1236 } | 1237 } |
| 1237 | 1238 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1651 } | 1652 } |
| 1652 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 1653 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 1653 return expectSemicolon(token); | 1654 return expectSemicolon(token); |
| 1654 } | 1655 } |
| 1655 | 1656 |
| 1656 Token parseEmptyStatement(Token token) { | 1657 Token parseEmptyStatement(Token token) { |
| 1657 listener.handleEmptyStatement(token); | 1658 listener.handleEmptyStatement(token); |
| 1658 return expectSemicolon(token); | 1659 return expectSemicolon(token); |
| 1659 } | 1660 } |
| 1660 } | 1661 } |
| OLD | NEW |