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

Side by Side Diff: pkg/dart_parser/lib/src/parser.dart

Issue 2642713002: Implement correct scope of for-in expression. (Closed)
Patch Set: Add comment to status files. Created 3 years, 11 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
« no previous file with comments | « pkg/dart_parser/lib/src/listener.dart ('k') | pkg/fasta/lib/src/kernel/body_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) 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 library dart_parser; 5 library dart_parser;
6 6
7 import 'package:dart_scanner/src/keyword.dart' show 7 import 'package:dart_scanner/src/keyword.dart' show
8 Keyword; 8 Keyword;
9 9
10 import 'package:dart_scanner/src/precedence.dart' show 10 import 'package:dart_scanner/src/precedence.dart' show
(...skipping 2754 matching lines...) Expand 10 before | Expand all | Expand 10 after
2765 listener.beginForStatementBody(token); 2765 listener.beginForStatementBody(token);
2766 token = parseStatement(token); 2766 token = parseStatement(token);
2767 listener.endForStatementBody(token); 2767 listener.endForStatementBody(token);
2768 listener.endForStatement(expressionCount, forToken, token); 2768 listener.endForStatement(expressionCount, forToken, token);
2769 return token; 2769 return token;
2770 } 2770 }
2771 2771
2772 Token parseForInRest(Token awaitToken, Token forToken, Token token) { 2772 Token parseForInRest(Token awaitToken, Token forToken, Token token) {
2773 assert(optional('in', token)); 2773 assert(optional('in', token));
2774 Token inKeyword = token; 2774 Token inKeyword = token;
2775 token = parseExpression(token.next); 2775 token = token.next;
2776 listener.beginForInExpression(token);
2777 token = parseExpression(token);
2778 listener.endForInExpression(token);
2776 token = expect(')', token); 2779 token = expect(')', token);
2777 listener.beginForInBody(token); 2780 listener.beginForInBody(token);
2778 token = parseStatement(token); 2781 token = parseStatement(token);
2779 listener.endForInBody(token); 2782 listener.endForInBody(token);
2780 listener.endForIn(awaitToken, forToken, inKeyword, token); 2783 listener.endForIn(awaitToken, forToken, inKeyword, token);
2781 return token; 2784 return token;
2782 } 2785 }
2783 2786
2784 Token parseWhileStatement(Token token) { 2787 Token parseWhileStatement(Token token) {
2785 Token whileToken = token; 2788 Token whileToken = token;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
3037 } 3040 }
3038 listener.handleContinueStatement(hasTarget, continueKeyword, token); 3041 listener.handleContinueStatement(hasTarget, continueKeyword, token);
3039 return expectSemicolon(token); 3042 return expectSemicolon(token);
3040 } 3043 }
3041 3044
3042 Token parseEmptyStatement(Token token) { 3045 Token parseEmptyStatement(Token token) {
3043 listener.handleEmptyStatement(token); 3046 listener.handleEmptyStatement(token);
3044 return expectSemicolon(token); 3047 return expectSemicolon(token);
3045 } 3048 }
3046 } 3049 }
OLDNEW
« no previous file with comments | « pkg/dart_parser/lib/src/listener.dart ('k') | pkg/fasta/lib/src/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698