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

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

Issue 2771983004: Implement character offsets for fields and enum constants. (Closed)
Patch Set: Remove TODO. 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/unhandled_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/unhandled_listener.dart b/pkg/front_end/lib/src/fasta/source/unhandled_listener.dart
index fb25b83af9554329b93749969b7a47a04e3f2eca..8854f7ca8d2ca0a878f6b8d6fa0419b915438d05 100644
--- a/pkg/front_end/lib/src/fasta/source/unhandled_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/unhandled_listener.dart
@@ -25,6 +25,10 @@ enum Unhandled {
// TODO(ahe): Get rid of this class when all listeners are complete.
abstract class UnhandledListener extends StackListener {
+ int popCharOffset() => -1;
+
+ List<String> popIdentifierList(int count) => popList(count);
+
@override
void endMetadataStar(int count, bool forParameter) {
debugEvent("MetadataStar");
@@ -34,7 +38,9 @@ abstract class UnhandledListener extends StackListener {
@override
void endConditionalUri(Token ifKeyword, Token equalitySign) {
debugEvent("ConditionalUri");
+ popCharOffset();
pop(); // URI.
+ if (equalitySign != null) popCharOffset();
popIfNotNull(equalitySign); // String.
pop(); // DottedName.
push(Unhandled.ConditionalUri);
@@ -70,7 +76,7 @@ abstract class UnhandledListener extends StackListener {
@override
void endDottedName(int count, Token firstIdentifier) {
debugEvent("DottedName");
- popList(count);
+ popIdentifierList(count);
push(Unhandled.DottedName);
}
}

Powered by Google App Engine
This is Rietveld 408576698