| 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 listener.handleQualified(period); | 565 listener.handleQualified(period); |
| 566 } | 566 } |
| 567 token = parseTypeVariablesOpt(token); | 567 token = parseTypeVariablesOpt(token); |
| 568 Token period = null; | 568 Token period = null; |
| 569 if (optional('.', token)) { | 569 if (optional('.', token)) { |
| 570 period = token; | 570 period = token; |
| 571 token = parseIdentifier(token.next); | 571 token = parseIdentifier(token.next); |
| 572 } | 572 } |
| 573 token = parseFormalParameters(token); | 573 token = parseFormalParameters(token); |
| 574 token = parseFunctionBody(token, false); | 574 token = parseFunctionBody(token, false); |
| 575 listener.endFactoryMethod(factoryKeyword, period); | 575 listener.endFactoryMethod(factoryKeyword, period, token); |
| 576 return token.next; | 576 return token.next; |
| 577 } | 577 } |
| 578 | 578 |
| 579 Token parseOperatorName(Token token) { | 579 Token parseOperatorName(Token token) { |
| 580 assert(optional('operator', token)); | 580 assert(optional('operator', token)); |
| 581 Token operator = token; | 581 Token operator = token; |
| 582 token = token.next; | 582 token = token.next; |
| 583 // TODO(ahe): Validate that [token] really is an operator. | 583 // TODO(ahe): Validate that [token] really is an operator. |
| 584 listener.handleOperatorName(operator, token); | 584 listener.handleOperatorName(operator, token); |
| 585 return token.next; | 585 return token.next; |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 } | 1401 } |
| 1402 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 1402 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 1403 return expectSemicolon(token); | 1403 return expectSemicolon(token); |
| 1404 } | 1404 } |
| 1405 | 1405 |
| 1406 Token parseEmptyStatement(Token token) { | 1406 Token parseEmptyStatement(Token token) { |
| 1407 listener.handleEmptyStatement(token); | 1407 listener.handleEmptyStatement(token); |
| 1408 return expectSemicolon(token); | 1408 return expectSemicolon(token); |
| 1409 } | 1409 } |
| 1410 } | 1410 } |
| OLD | NEW |