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

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

Issue 2185873002: Default trailing comma support to `true` (#26647). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/analyzer/lib/src/generated/engine.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 f63bb70615a521d647311d2c4335ae9acddaa1a5..fcf9b0132a2d4265d7527c05f679a4c09e57fd81 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -2189,12 +2189,6 @@ class Parser {
bool parseGenericMethodComments = false;
/**
- * A flag indicating whether the parser is to parse trailing commas in
- * parameter and argument lists (sdk#26647).
- */
- bool parseTrailingCommas = false;
-
- /**
* Initialize a newly created parser to parse tokens in the given [_source]
* and to report any errors that are found to the given [_errorListener].
*/
@@ -2330,7 +2324,7 @@ class Parser {
bool foundNamedArgument = argument is NamedExpression;
bool generatedError = false;
while (_optional(TokenType.COMMA)) {
- if (parseTrailingCommas && _matches(TokenType.CLOSE_PAREN)) {
+ if (_matches(TokenType.CLOSE_PAREN)) {
break;
}
argument = parseArgument();
@@ -6146,7 +6140,7 @@ class Parser {
type = _currentToken.type;
// Advance past trailing commas as appropriate.
- if (parseTrailingCommas && type == TokenType.COMMA) {
+ if (type == TokenType.COMMA) {
// Only parse commas trailing normal (non-positional/named) params.
if (rightSquareBracket == null && rightCurlyBracket == null) {
Token next = _peek();
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698