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

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

Issue 2727753002: Parse InstanceCreationExpression with Fasta. (Closed)
Patch Set: Created 3 years, 10 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 9947775894f4b28d423fb7153acb2d7a27d0db4b..be2a73bbed4fc195aab9e2e65ea67470c743c50d 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -69,6 +69,32 @@ class AstBuilder extends ScopeListener {
}
@override
+ void handleNoConstructorReferenceContinuationAfterTypeArguments(Token token) {
+ debugEvent("NoConstructorReferenceContinuationAfterTypeArguments");
+ push(NullValue.ConstructorReferenceContinuationAfterTypeArguments);
+ }
+
+ @override
+ void endConstructorReference(
+ Token start, Token periodBeforeName, Token endToken) {
+ debugEvent("ConstructorReference");
+ SimpleIdentifier constructorName = pop();
+ TypeArgumentList typeArguments = pop();
+ Identifier typeNameIdentifier = pop();
+ push(ast.constructorName(ast.typeName(typeNameIdentifier, typeArguments),
+ toAnalyzerToken(periodBeforeName), constructorName));
+ }
+
+ @override
+ void handleNewExpression(Token token) {
+ debugEvent("NewExpression");
+ MethodInvocation arguments = pop();
+ ConstructorName constructorName = pop();
+ push(ast.instanceCreationExpression(
+ toAnalyzerToken(token), constructorName, arguments.argumentList));
+ }
+
+ @override
void handleParenthesizedExpression(BeginGroupToken token) {
debugEvent("ParenthesizedExpression");
Expression expression = pop();

Powered by Google App Engine
This is Rietveld 408576698