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

Side by Side Diff: pkg/front_end/lib/src/fasta/parser/identifier_context.dart

Issue 2769063003: Allow literal symbols as constant expressions. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Information about the parser state which is passed to the listener at the 5 /// Information about the parser state which is passed to the listener at the
6 /// time an identifier is encountered. 6 /// time an identifier is encountered.
7 /// 7 ///
8 /// This can be used by the listener to determine the context in which the 8 /// This can be used by the listener to determine the context in which the
9 /// identifier appears; that in turn can help the listener decide how to resolve 9 /// identifier appears; that in turn can help the listener decide how to resolve
10 /// the identifier (if the listener is doing resolution). 10 /// the identifier (if the listener is doing resolution).
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 this.inLibraryOrPartOfDeclaration: false, 284 this.inLibraryOrPartOfDeclaration: false,
285 this.inSymbol: false, 285 this.inSymbol: false,
286 this.isContinuation: false, 286 this.isContinuation: false,
287 this.isScopeReference: false, 287 this.isScopeReference: false,
288 this.isBuiltInIdentifierAllowed: true, 288 this.isBuiltInIdentifierAllowed: true,
289 bool allowedInConstantExpression}) 289 bool allowedInConstantExpression})
290 : this.allowedInConstantExpression = 290 : this.allowedInConstantExpression =
291 // Generally, declarations are legal in constant expressions. A 291 // Generally, declarations are legal in constant expressions. A
292 // continuation doesn't affect constant expressions: if what it's 292 // continuation doesn't affect constant expressions: if what it's
293 // continuing is a problem, it has already been reported. 293 // continuing is a problem, it has already been reported.
294 allowedInConstantExpression ?? (inDeclaration || isContinuation); 294 allowedInConstantExpression ??
295 (inDeclaration || isContinuation || inSymbol);
295 296
296 String toString() => _name; 297 String toString() => _name;
297 } 298 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698