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

Unified Diff: pkg/front_end/lib/src/fasta/source/diet_listener.dart

Issue 2751913002: Parse constructor field initializers with Fasta. (Closed)
Patch Set: Fix for DietListener test failure. 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/source/diet_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/diet_listener.dart b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
index defefc3e1a710fa7d248c79d2025b06586b10c77..825c468daa3417fb4341ce176badfe3cb2d48b56 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -495,6 +495,9 @@ class DietListener extends StackListener {
bool allowAbstract = asyncModifier == AsyncMarker.Sync;
parser.parseFunctionBody(token, isExpression, allowAbstract);
var body = listener.pop();
+ if (listener.stack.length == 1) {
ahe 2017/04/06 14:25:21 Could you explain what this is for?
scheglov 2017/04/06 15:51:55 AstBuilder puts more data on the stack than the ot
ahe 2017/04/06 15:57:32 Would it be possible to not do that? I'm trying to
scheglov 2017/04/06 16:06:05 The stack is empty after parsing a function. But i
ahe 2017/05/31 14:15:38 What do you mean by removing a function body?
scheglov 2017/05/31 21:46:20 The statement "var body = listener.pop();" removes
ahe 2017/06/01 12:13:01 I see. After calling parseFunctionBody, there shou
+ listener.pop(); // constructor initializers
+ }
listener.checkEmpty(token.charOffset);
listener.finishFunction(formals, asyncModifier, body);
} on InputError {
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart ('k') | pkg/front_end/lib/src/fasta/source/stack_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698