| 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 /** | 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 (aka a token stream). | 7 * all tokens in a linked list (aka a token stream). |
| 8 * | 8 * |
| 9 * The class [Scanner] is used to generate a token stream. See the | 9 * The class [Scanner] is used to generate a token stream. See the |
| 10 * file scanner.dart. | 10 * file scanner.dart. |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 return token.next; | 666 return token.next; |
| 667 } else { | 667 } else { |
| 668 return parseIdentifier(token); | 668 return parseIdentifier(token); |
| 669 } | 669 } |
| 670 } | 670 } |
| 671 | 671 |
| 672 Token parseFunction(Token token, Token getOrSet) { | 672 Token parseFunction(Token token, Token getOrSet) { |
| 673 listener.beginFunction(token); | 673 listener.beginFunction(token); |
| 674 token = parseModifiers(token); | 674 token = parseModifiers(token); |
| 675 if (getOrSet === token) token = token.next; | 675 if (getOrSet === token) token = token.next; |
| 676 token = parseReturnTypeOpt(token); | |
| 677 if (getOrSet === token) token = token.next; | |
| 678 listener.beginFunctionName(token); | |
| 679 if (optional('operator', token)) { | 676 if (optional('operator', token)) { |
| 677 listener.handleNoType(token); |
| 678 listener.beginFunctionName(token); |
| 680 token = parseOperatorName(token); | 679 token = parseOperatorName(token); |
| 681 } else { | 680 } else { |
| 682 token = parseIdentifier(token); | 681 token = parseReturnTypeOpt(token); |
| 682 if (getOrSet === token) token = token.next; |
| 683 listener.beginFunctionName(token); |
| 684 if (optional('operator', token)) { |
| 685 token = parseOperatorName(token); |
| 686 } else { |
| 687 token = parseIdentifier(token); |
| 688 } |
| 683 } | 689 } |
| 684 token = parseQualifiedRestOpt(token); | 690 token = parseQualifiedRestOpt(token); |
| 685 listener.endFunctionName(token); | 691 listener.endFunctionName(token); |
| 686 token = parseFormalParameters(token); | 692 token = parseFormalParameters(token); |
| 687 token = parseInitializersOpt(token); | 693 token = parseInitializersOpt(token); |
| 688 token = parseFunctionBody(token, false); | 694 token = parseFunctionBody(token, false); |
| 689 listener.endFunction(getOrSet, token); | 695 listener.endFunction(getOrSet, token); |
| 690 return token.next; | 696 return token.next; |
| 691 } | 697 } |
| 692 | 698 |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1715 } | 1721 } |
| 1716 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 1722 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 1717 return expectSemicolon(token); | 1723 return expectSemicolon(token); |
| 1718 } | 1724 } |
| 1719 | 1725 |
| 1720 Token parseEmptyStatement(Token token) { | 1726 Token parseEmptyStatement(Token token) { |
| 1721 listener.handleEmptyStatement(token); | 1727 listener.handleEmptyStatement(token); |
| 1722 return expectSemicolon(token); | 1728 return expectSemicolon(token); |
| 1723 } | 1729 } |
| 1724 } | 1730 } |
| OLD | NEW |