Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: lib/compiler/implementation/scanner/parser.dart

Issue 10696147: Patch methods in classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 token = parseFunctionBody(token, false); 631 token = parseFunctionBody(token, false);
632 listener.endMethod(getOrSet, start, token); 632 listener.endMethod(getOrSet, start, token);
633 } 633 }
634 return token.next; 634 return token.next;
635 } 635 }
636 636
637 Token parseFactoryMethod(Token token) { 637 Token parseFactoryMethod(Token token) {
638 assert((optional('external', token) && optional('factory', token.next)) || 638 assert((optional('external', token) && optional('factory', token.next)) ||
639 optional('factory', token)); 639 optional('factory', token));
640 Token start = token; 640 Token start = token;
641 if (start.stringValue === 'external') token = token.next; 641 if (token.stringValue === 'external') token = token.next;
642 Token factoryKeyword = token; 642 Token factoryKeyword = token;
643 listener.beginFactoryMethod(factoryKeyword); 643 listener.beginFactoryMethod(factoryKeyword);
644 token = token.next; // Skip 'factory'. 644 token = token.next; // Skip 'factory'.
645 token = parseIdentifier(token); 645 token = parseIdentifier(token);
646 token = parseQualifiedRestOpt(token); 646 token = parseQualifiedRestOpt(token);
647 token = parseTypeVariablesOpt(token); 647 token = parseTypeVariablesOpt(token);
648 Token period = null; 648 Token period = null;
649 if (optional('.', token)) { 649 if (optional('.', token)) {
650 period = token; 650 period = token;
651 token = parseIdentifier(token.next); 651 token = parseIdentifier(token.next);
652 } 652 }
653 token = parseFormalParameters(token); 653 token = parseFormalParameters(token);
654 token = parseFunctionBody(token, false); 654 token = parseFunctionBody(token, false);
655 listener.endFactoryMethod(factoryKeyword, period, start); 655 listener.endFactoryMethod(start, period, token);
656 return token.next; 656 return token.next;
657 } 657 }
658 658
659 Token parseOperatorName(Token token) { 659 Token parseOperatorName(Token token) {
660 assert(optional('operator', token)); 660 assert(optional('operator', token));
661 if (isUserDefinableOperator(token.next.stringValue)) { 661 if (isUserDefinableOperator(token.next.stringValue)) {
662 Token operator = token; 662 Token operator = token;
663 token = token.next; 663 token = token.next;
664 listener.handleOperatorName(operator, token); 664 listener.handleOperatorName(operator, token);
665 return token.next; 665 return token.next;
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 } 1714 }
1715 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1715 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1716 return expectSemicolon(token); 1716 return expectSemicolon(token);
1717 } 1717 }
1718 1718
1719 Token parseEmptyStatement(Token token) { 1719 Token parseEmptyStatement(Token token) {
1720 listener.handleEmptyStatement(token); 1720 listener.handleEmptyStatement(token);
1721 return expectSemicolon(token); 1721 return expectSemicolon(token);
1722 } 1722 }
1723 } 1723 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698