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

Unified Diff: pkg/front_end/lib/src/fasta/parser/listener.dart

Issue 2804753003: Parse type substitution comments /*=T*/ in variable declarations with Fasta. (Closed)
Patch Set: Move generic comment 'inject' methods to Listener. 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
Index: pkg/front_end/lib/src/fasta/parser/listener.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/listener.dart b/pkg/front_end/lib/src/fasta/parser/listener.dart
index 3bfdb81ecdba6022adde59acbf91218858c1e913..bff471fa420003ec2f219c6c6f887ae7299c107c 100644
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart
@@ -1028,6 +1028,28 @@ class Listener {
logEvent("Script");
}
+ /// Matches a generic comment type substitution and injects it into the token
+ /// stream before the given [token].
+ Token injectGenericCommentTypeAssign(Token token) {
+ return token;
+ }
+
+ /// Matches a generic comment type parameters or type arguments and injects
+ /// them into the token stream before the given [token].
+ Token injectGenericCommentTypeList(Token token) {
+ return token;
+ }
+
+ /// If the [tokenWithComment] has a type substitution comment /*=T*/, then
+ /// the comment should be scanned into new tokens, and these tokens inserted
+ /// instead of tokens from the [tokenToStartReplacing] to the
+ /// [tokenWithComment]. Returns the first newly inserted token, or the
+ /// original [tokenWithComment].
+ Token replaceTokenWithGenericCommentTypeAssign(
+ Token tokenToStartReplacing, Token tokenWithComment) {
+ return tokenToStartReplacing;
+ }
+
/// Creates a new synthetic token whose `next` pointer points to [next].
///
/// If [next] is `null`, `null` is returned.

Powered by Google App Engine
This is Rietveld 408576698