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

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

Issue 2716043003: Support for the 'covariant' keyword for formal parameters. (Closed)
Patch Set: Created 3 years, 10 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/parser.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index 65f41aed1056906e6b6fc50ace4721f84942a2de..2a58ae6dbfcc3a8c525a84b269a5f7552ef7dc96 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -499,8 +499,10 @@ class Parser {
// modifier.
// This enables the case where `covariant` is the name of the parameter:
// void foo(covariant);
+ Token covariantKeyword;
if (identical(token.stringValue, 'covariant') &&
(token.next.isIdentifier() || isModifier(token.next))) {
+ covariantKeyword = token;
token = token.next;
}
token = parseModifiers(token);
@@ -574,7 +576,7 @@ class Parser {
} else {
listener.handleFormalParameterWithoutValue(token);
}
- listener.endFormalParameter(thisKeyword, kind);
+ listener.endFormalParameter(covariantKeyword, thisKeyword, kind);
return token;
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698