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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 2488043002: Enable generic method support by default (Closed)
Patch Set: clean up Created 4 years, 1 month 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/analyzer/lib/src/generated/incremental_resolver.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index e325da2e537b216f1974ea5428c4e587d60efe76..146f0ab1820117d8d6af08d80d78b9851f392388 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -238,6 +238,7 @@ class Parser {
/**
* A flag indicating whether the parser is to parse generic method syntax.
*/
+ @deprecated
bool parseGenericMethods = false;
/**
@@ -1400,7 +1401,7 @@ class Parser {
// function type alias that was parsed.
_parseFunctionTypeAlias(commentAndMetadata, getAndAdvance());
return null;
- } else if (parseGenericMethods) {
+ } else {
Token token = _skipTypeParameterList(_peek());
if (token != null && _tokenMatches(token, TokenType.OPEN_PAREN)) {
return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
@@ -1489,7 +1490,7 @@ class Parser {
methodName,
typeParameters,
parameters);
- } else if (parseGenericMethods && _tokenMatches(next, TokenType.LT)) {
+ } else if (_tokenMatches(next, TokenType.LT)) {
return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
modifiers.externalKeyword, modifiers.staticKeyword, type);
} else if (_tokenMatches(next, TokenType.OPEN_CURLY_BRACKET)) {
@@ -4118,7 +4119,7 @@ class Parser {
type == TokenType.PERIOD ||
type == TokenType.QUESTION_PERIOD ||
type == TokenType.OPEN_PAREN ||
- (parseGenericMethods && type == TokenType.LT) ||
+ type == TokenType.LT ||
type == TokenType.INDEX) {
do {
if (_isLikelyArgumentList()) {
@@ -5763,9 +5764,6 @@ class Parser {
if (_matches(TokenType.OPEN_PAREN)) {
return true;
}
- if (!parseGenericMethods) {
- return false;
- }
Token token = skipTypeArgumentList(_currentToken);
return token != null && _tokenMatches(token, TokenType.OPEN_PAREN);
}
@@ -5824,9 +5822,6 @@ class Parser {
}
bool _isPeekGenericTypeParametersAndOpenParen() {
- if (!parseGenericMethods) {
- return false;
- }
Token token = _skipTypeParameterList(_peek());
return token != null && _tokenMatches(token, TokenType.OPEN_PAREN);
}
@@ -6618,8 +6613,7 @@ class Parser {
* See [parseGenericMethodComments].
*/
TypeParameterList _parseGenericMethodTypeParameters() {
- if (parseGenericMethods && _matches(TokenType.LT) ||
- _injectGenericCommentTypeList()) {
+ if (_matches(TokenType.LT) || _injectGenericCommentTypeList()) {
return parseTypeParameterList();
}
return null;
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698