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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2747083005: Parse for-in statements with Fasta. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../parser/parser.dart' show FormalParameterType, optional; 7 import '../parser/parser.dart' show FormalParameterType, optional;
8 8
9 import '../parser/error_kind.dart' show ErrorKind; 9 import '../parser/error_kind.dart' show ErrorKind;
10 10
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 1891
1892 @override 1892 @override
1893 void endForInExpression(Token token) { 1893 void endForInExpression(Token token) {
1894 debugEvent("ForInExpression"); 1894 debugEvent("ForInExpression");
1895 Expression expression = popForValue(); 1895 Expression expression = popForValue();
1896 exitLocalScope(); 1896 exitLocalScope();
1897 push(expression ?? NullValue.Expression); 1897 push(expression ?? NullValue.Expression);
1898 } 1898 }
1899 1899
1900 @override 1900 @override
1901 void endForIn( 1901 void endForIn(Token awaitToken, Token forToken, Token leftParenthesis,
1902 Token awaitToken, Token forToken, Token inKeyword, Token endToken) { 1902 Token inKeyword, Token rightParenthesis, Token endToken) {
1903 debugEvent("ForIn"); 1903 debugEvent("ForIn");
1904 Statement body = popStatement(); 1904 Statement body = popStatement();
1905 Expression expression = popForValue(); 1905 Expression expression = popForValue();
1906 var lvalue = pop(); 1906 var lvalue = pop();
1907 exitLocalScope(); 1907 exitLocalScope();
1908 JumpTarget continueTarget = exitContinueTarget(); 1908 JumpTarget continueTarget = exitContinueTarget();
1909 JumpTarget breakTarget = exitBreakTarget(); 1909 JumpTarget breakTarget = exitBreakTarget();
1910 if (continueTarget.hasUsers) { 1910 if (continueTarget.hasUsers) {
1911 body = new LabeledStatement(body); 1911 body = new LabeledStatement(body);
1912 continueTarget.resolveContinues(body); 1912 continueTarget.resolveContinues(body);
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 } else if (node is PrefixBuilder) { 2769 } else if (node is PrefixBuilder) {
2770 return node.name; 2770 return node.name;
2771 } else if (node is ThisAccessor) { 2771 } else if (node is ThisAccessor) {
2772 return node.isSuper ? "super" : "this"; 2772 return node.isSuper ? "super" : "this";
2773 } else if (node is BuilderAccessor) { 2773 } else if (node is BuilderAccessor) {
2774 return node.plainNameForRead; 2774 return node.plainNameForRead;
2775 } else { 2775 } else {
2776 return internalError("Unhandled: ${node.runtimeType}"); 2776 return internalError("Unhandled: ${node.runtimeType}");
2777 } 2777 }
2778 } 2778 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698