| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 token = parseType(token.next); | 225 token = parseType(token.next); |
| 226 ++interfacesCount; | 226 ++interfacesCount; |
| 227 } while (optional(',', token)); | 227 } while (optional(',', token)); |
| 228 } | 228 } |
| 229 token = parseClassBody(token); | 229 token = parseClassBody(token); |
| 230 listener.endClassDeclaration(interfacesCount, begin, extendsKeyword, | 230 listener.endClassDeclaration(interfacesCount, begin, extendsKeyword, |
| 231 implementsKeyword, token); | 231 implementsKeyword, token); |
| 232 return token.next; | 232 return token.next; |
| 233 } | 233 } |
| 234 | 234 |
| 235 |
| 235 Token parseString(Token token) { | 236 Token parseString(Token token) { |
| 236 if (token.kind === STRING_TOKEN) { | 237 if (token.kind === STRING_TOKEN) { |
| 237 listener.handleLiteralString(token); | 238 listener.handleLiteralString(token); |
| 238 return token.next; | 239 return token.next; |
| 239 } else { | 240 } else { |
| 240 return listener.expected('string', token); | 241 return listener.expected('string', token); |
| 241 } | 242 } |
| 242 } | 243 } |
| 243 | 244 |
| 244 Token parseIdentifier(Token token) { | 245 Token parseIdentifier(Token token) { |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 } | 1554 } |
| 1554 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 1555 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 1555 return expectSemicolon(token); | 1556 return expectSemicolon(token); |
| 1556 } | 1557 } |
| 1557 | 1558 |
| 1558 Token parseEmptyStatement(Token token) { | 1559 Token parseEmptyStatement(Token token) { |
| 1559 listener.handleEmptyStatement(token); | 1560 listener.handleEmptyStatement(token); |
| 1560 return expectSemicolon(token); | 1561 return expectSemicolon(token); |
| 1561 } | 1562 } |
| 1562 } | 1563 } |
| OLD | NEW |