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

Side by Side Diff: frog/leg/scanner/parser.dart

Issue 9027002: Support factory methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
« no previous file with comments | « frog/leg/scanner/listener.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « frog/leg/scanner/listener.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698