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

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

Issue 2747803004: Parse assert 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 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 exitLoopOrSwitch(result); 2015 exitLoopOrSwitch(result);
2016 } 2016 }
2017 2017
2018 @override 2018 @override
2019 void handleEmptyStatement(Token token) { 2019 void handleEmptyStatement(Token token) {
2020 debugEvent("EmptyStatement"); 2020 debugEvent("EmptyStatement");
2021 push(new EmptyStatement()); 2021 push(new EmptyStatement());
2022 } 2022 }
2023 2023
2024 @override 2024 @override
2025 void handleAssertStatement( 2025 void handleAssertStatement(Token assertKeyword, Token leftParenthesis,
2026 Token assertKeyword, Token commaToken, Token semicolonToken) { 2026 Token commaToken, Token rightParenthesis, Token semicolonToken) {
2027 debugEvent("AssertStatement"); 2027 debugEvent("AssertStatement");
2028 Expression message = popForValueIfNotNull(commaToken); 2028 Expression message = popForValueIfNotNull(commaToken);
2029 Expression condition = popForValue(); 2029 Expression condition = popForValue();
2030 push(new AssertStatement(condition, message)); 2030 push(new AssertStatement(condition, message));
2031 } 2031 }
2032 2032
2033 @override 2033 @override
2034 void endYieldStatement(Token yieldToken, Token starToken, Token endToken) { 2034 void endYieldStatement(Token yieldToken, Token starToken, Token endToken) {
2035 debugEvent("YieldStatement"); 2035 debugEvent("YieldStatement");
2036 push(new YieldStatement(popForValue(), isYieldStar: starToken != null)); 2036 push(new YieldStatement(popForValue(), isYieldStar: starToken != null));
(...skipping 732 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