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

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

Issue 2978073002: Add closeBraceTokenFor and use it instead of BeginToken. (Closed)
Patch Set: Created 3 years, 5 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/front_end/lib/src/fasta/parser/util.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7927afc1be23379fcabb1e3f57a2bcf945d9143a..0fd97f655d43c98e407bc2c091f71e8cc326fb51 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -10,7 +10,7 @@ import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
import 'package:kernel/core_types.dart' show CoreTypes;
-import '../../scanner/token.dart' show BeginToken, Token;
+import '../../scanner/token.dart' show Token;
import '../builder/builder.dart';
@@ -25,7 +25,7 @@ import '../kernel/body_builder.dart' show BodyBuilder;
import '../parser/native_support.dart'
show removeNativeClause, skipNativeClause;
-import '../parser.dart' show MemberKind, Parser, optional;
+import '../parser.dart' show MemberKind, Parser, closeBraceTokenFor, optional;
import '../problems.dart' show internalProblem;
@@ -378,11 +378,12 @@ class DietListener extends StackListener {
void endFactoryMethod(
Token beginToken, Token factoryKeyword, Token endToken) {
debugEvent("FactoryMethod");
- BeginToken bodyToken = pop();
+ Token bodyToken = pop();
String name = pop();
Token metadata = pop();
checkEmpty(beginToken.charOffset);
- if (bodyToken == null || optional("=", bodyToken.endGroup.next)) {
+ if (bodyToken == null ||
+ optional("=", closeBraceTokenFor(bodyToken).next)) {
// TODO(ahe): Don't skip this. We need to compile metadata and
// redirecting factory bodies.
return;
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/util.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698