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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 token = parseIdentifier(token.next); | 718 token = parseIdentifier(token.next); |
719 } | 719 } |
720 token = parseFormalParameters(token); | 720 token = parseFormalParameters(token); |
721 token = parseFunctionBody(token, false); | 721 token = parseFunctionBody(token, false); |
722 listener.endFactoryMethod(start, period, token); | 722 listener.endFactoryMethod(start, period, token); |
723 return token.next; | 723 return token.next; |
724 } | 724 } |
725 | 725 |
726 Token parseOperatorName(Token token) { | 726 Token parseOperatorName(Token token) { |
727 assert(optional('operator', token)); | 727 assert(optional('operator', token)); |
728 if (isUserDefinableOperator(token.next.stringValue) | 728 if (isUserDefinableOperator(token.next.stringValue)) { |
729 // TODO(ahe): Remove negate. | |
730 || token.next.value == const SourceString("negate")) { | |
731 Token operator = token; | 729 Token operator = token; |
732 token = token.next; | 730 token = token.next; |
733 listener.handleOperatorName(operator, token); | 731 listener.handleOperatorName(operator, token); |
734 return token.next; | 732 return token.next; |
735 } else { | 733 } else { |
736 return parseIdentifier(token); | 734 return parseIdentifier(token); |
737 } | 735 } |
738 } | 736 } |
739 | 737 |
740 Token parseFunction(Token token, Token getOrSet) { | 738 Token parseFunction(Token token, Token getOrSet) { |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 } | 1838 } |
1841 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 1839 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
1842 return expectSemicolon(token); | 1840 return expectSemicolon(token); |
1843 } | 1841 } |
1844 | 1842 |
1845 Token parseEmptyStatement(Token token) { | 1843 Token parseEmptyStatement(Token token) { |
1846 listener.handleEmptyStatement(token); | 1844 listener.handleEmptyStatement(token); |
1847 return expectSemicolon(token); | 1845 return expectSemicolon(token); |
1848 } | 1846 } |
1849 } | 1847 } |
OLD | NEW |