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

Unified Diff: runtime/vm/parser.cc

Issue 2411633002: Add `=` as default-value separator for named parameters. (Closed)
Patch Set: Created 4 years, 2 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: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index cb9c620101ec318ff2baffb48bf4f5a698cea49e..78fe0942664f108d8272055a7e463501973d2fca 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -2184,7 +2184,7 @@ void Parser::ParseFormalParameter(bool allow_explicit_default_value,
if (params->has_optional_positional_parameters) {
ExpectToken(Token::kASSIGN);
} else {
- ExpectToken(Token::kCOLON);
+ ConsumeToken();
eernst 2016/10/11 20:59:50 It was not obvious to me why this would work, but
Lasse Reichstein Nielsen 2016/10/12 06:10:58 Correct. ConsumeToken is used to drop the current
}
params->num_optional_parameters++;
params->has_explicit_default_values = true; // Also if explicitly NULL.

Powered by Google App Engine
This is Rietveld 408576698