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

Unified Diff: pkg/front_end/lib/src/scanner/token.dart

Issue 2794653002: fasta tokens implement analyzer token API (Closed)
Patch Set: merge Created 3 years, 8 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/scanner/scanner.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/scanner/token.dart
diff --git a/pkg/front_end/lib/src/scanner/token.dart b/pkg/front_end/lib/src/scanner/token.dart
index 5105a31b357335bb0c639cf41e6a7b510cfc55bd..cb922e8f727df031b0c9723905be48574f12006d 100644
--- a/pkg/front_end/lib/src/scanner/token.dart
+++ b/pkg/front_end/lib/src/scanner/token.dart
@@ -600,6 +600,38 @@ class StringTokenWithComment extends StringToken implements TokenWithComment {
}
/**
+ * A synthetic keyword token.
+ */
+class SyntheticKeywordToken extends KeywordToken {
+ /**
+ * Initialize a newly created token to represent the given [keyword] at the
+ * given [offset].
+ */
+ SyntheticKeywordToken(Keyword keyword, int offset) : super(keyword, offset);
+
+ @override
+ int get length => 0;
+
+ @override
+ Token copy() => new SyntheticKeywordToken(keyword, offset);
+}
+
+/**
+ * A token whose value is independent of it's type.
+ */
+class SyntheticStringToken extends StringToken {
+ /**
+ * Initialize a newly created token to represent a token of the given [type]
+ * with the given [value] at the given [offset].
+ */
+ SyntheticStringToken(TokenType type, String value, int offset)
+ : super(type, value, offset);
+
+ @override
+ bool get isSynthetic => true;
+}
+
+/**
* A token that was scanned from the input. Each token knows which tokens
* precede and follow it, acting as a link in a doubly linked list of tokens.
*
« no previous file with comments | « pkg/front_end/lib/src/scanner/scanner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698