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

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

Issue 10880040: Support abstract getters without parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update language.status Created 8 years, 3 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 bool isField; 649 bool isField;
650 while (true) { 650 while (true) {
651 // Loop to allow the listener to rewrite the token stream for 651 // Loop to allow the listener to rewrite the token stream for
652 // error handling. 652 // error handling.
653 final String value = token.stringValue; 653 final String value = token.stringValue;
654 if ((value === '(') || (value === '.') || (value === '{') || 654 if ((value === '(') || (value === '.') || (value === '{') ||
655 (value === '=>')) { 655 (value === '=>')) {
656 isField = false; 656 isField = false;
657 break; 657 break;
658 } else if ((value === '=') || (value === ';') || (value === ',')) { 658 } else if (value === ';') {
659 if (getOrSet != null) {
660 // If we found a "get" keyword, this must be an abstract
661 // getter.
662 isField = (getOrSet.stringValue !== 'get');
663 // TODO(ahe): This feels like a hack.
664 } else {
665 isField = true;
666 }
667 break;
668 } else if ((value === '=') || (value === ',')) {
659 isField = true; 669 isField = true;
660 break; 670 break;
661 } else { 671 } else {
662 token = listener.unexpected(token); 672 token = listener.unexpected(token);
663 if (token.kind === EOF_TOKEN) { 673 if (token.kind === EOF_TOKEN) {
664 // TODO(ahe): This is a hack, see parseTopLevelMember. 674 // TODO(ahe): This is a hack, see parseTopLevelMember.
665 listener.endFields(1, start, token); 675 listener.endFields(1, start, token);
666 return token; 676 return token;
667 } 677 }
668 } 678 }
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1828 } 1838 }
1829 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1839 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1830 return expectSemicolon(token); 1840 return expectSemicolon(token);
1831 } 1841 }
1832 1842
1833 Token parseEmptyStatement(Token token) { 1843 Token parseEmptyStatement(Token token) {
1834 listener.handleEmptyStatement(token); 1844 listener.handleEmptyStatement(token);
1835 return expectSemicolon(token); 1845 return expectSemicolon(token);
1836 } 1846 }
1837 } 1847 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/scanner/keyword.dart ('k') | dart/lib/compiler/implementation/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698