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

Unified Diff: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart

Issue 2733913002: Fix for parsing 'const X()' 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
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8eda5e59bbc29abcd5398edbc659b47ca61eace5..890c97713aa812f85e03d33096b43e6825b03757 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -77,8 +77,12 @@ class AstBuilder extends ScopeListener {
}
@override
- void handleNewExpression(Token token) {
- debugEvent("NewExpression");
+ void handleConstExpression(Token token) {
+ debugEvent("ConstExpression");
+ _handleInstanceCreation(token);
+ }
+
+ void _handleInstanceCreation(Token token) {
MethodInvocation arguments = pop();
ConstructorName constructorName = pop();
push(ast.instanceCreationExpression(
@@ -86,6 +90,12 @@ class AstBuilder extends ScopeListener {
}
@override
+ void handleNewExpression(Token token) {
+ debugEvent("NewExpression");
+ _handleInstanceCreation(token);
+ }
+
+ @override
void handleParenthesizedExpression(BeginGroupToken token) {
debugEvent("ParenthesizedExpression");
Expression expression = pop();
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698