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

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

Issue 2802693004: Handle const list and map literals. (Closed)
Patch Set: 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f323b4519c356cb29e55355deacd0e461ec1286a..7b11fe708f4fc37258e0fd36c437822aed3a9dfd 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -3093,15 +3093,24 @@ class Parser {
token = _injectGenericCommentTypeList(token);
final String value = token.stringValue;
if ((identical(value, '[')) || (identical(value, '[]'))) {
+ listener.beginConstLiteral(token);
listener.handleNoTypeArguments(token);
- return parseLiteralListSuffix(token, constKeyword);
+ token = parseLiteralListSuffix(token, constKeyword);
+ listener.endConstLiteral(token);
+ return token;
}
if (identical(value, '{')) {
+ listener.beginConstLiteral(token);
listener.handleNoTypeArguments(token);
- return parseLiteralMapSuffix(token, constKeyword);
+ token = parseLiteralMapSuffix(token, constKeyword);
+ listener.endConstLiteral(token);
+ return token;
}
if (identical(value, '<')) {
- return parseLiteralListOrMapOrFunction(token, constKeyword);
+ listener.beginConstLiteral(token);
+ token = parseLiteralListOrMapOrFunction(token, constKeyword);
+ listener.endConstLiteral(token);
+ return token;
}
listener.beginConstExpression(constKeyword);
token = parseConstructorReference(token);
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698