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

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

Issue 10558023: New treatment of native methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 if (!isExpression) { 720 if (!isExpression) {
721 expectSemicolon(token); 721 expectSemicolon(token);
722 listener.endReturnStatement(true, begin, token); 722 listener.endReturnStatement(true, begin, token);
723 } else { 723 } else {
724 listener.endReturnStatement(true, begin, null); 724 listener.endReturnStatement(true, begin, null);
725 } 725 }
726 return token; 726 return token;
727 } 727 }
728 Token begin = token; 728 Token begin = token;
729 int statementCount = 0; 729 int statementCount = 0;
730 listener.beginFunctionBody(begin);
731 if (!optional('{', token)) { 730 if (!optional('{', token)) {
732 return listener.expectedFunctionBody(token); 731 return listener.expectedFunctionBody(token);
733 } else {
734 token = token.next;
735 } 732 }
733
734 listener.beginFunctionBody(begin);
735 token = token.next;
736 while (notEofOrValue('}', token)) { 736 while (notEofOrValue('}', token)) {
737 token = parseStatement(token); 737 token = parseStatement(token);
738 ++statementCount; 738 ++statementCount;
739 } 739 }
740 listener.endFunctionBody(statementCount, begin, token); 740 listener.endFunctionBody(statementCount, begin, token);
741 expect('}', token); 741 expect('}', token);
742 return token; 742 return token;
743 } 743 }
744 744
745 Token parseStatement(Token token) { 745 Token parseStatement(Token token) {
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 } 1670 }
1671 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1671 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1672 return expectSemicolon(token); 1672 return expectSemicolon(token);
1673 } 1673 }
1674 1674
1675 Token parseEmptyStatement(Token token) { 1675 Token parseEmptyStatement(Token token) {
1676 listener.handleEmptyStatement(token); 1676 listener.handleEmptyStatement(token);
1677 return expectSemicolon(token); 1677 return expectSemicolon(token);
1678 } 1678 }
1679 } 1679 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698