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

Unified Diff: pkg/front_end/lib/src/fasta/analyzer/ast_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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
index e4e9f48e0cc86b17888070951a485d1e0cceb751..9ce58150ec1bfb64d6c9235c4fe2ca72f0a7d0ec 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -579,6 +579,22 @@ class AstBuilder extends ScopeListener {
push(ast.typeName(name, arguments)..type = cls?.rawType);
}
+ @override
+ void handleAssertStatement(Token assertKeyword, Token leftParenthesis,
+ Token comma, Token rightParenthesis, Token semicolon) {
+ debugEvent("AssertStatement");
+ Expression message = popIfNotNull(comma);
+ Expression condition = pop();
+ push(ast.assertStatement(
+ toAnalyzerToken(assertKeyword),
+ toAnalyzerToken(leftParenthesis),
+ condition,
+ toAnalyzerToken(comma),
+ message,
+ toAnalyzerToken(rightParenthesis),
+ toAnalyzerToken(semicolon)));
+ }
+
void handleAsOperator(Token operator, Token endToken) {
debugEvent("AsOperator");
TypeAnnotation type = pop();
« no previous file with comments | « pkg/compiler/lib/src/parser/node_listener.dart ('k') | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698