OLD | NEW |
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 /// invocation (e.g. `foo` in `f(foo: 0);`. | 242 /// invocation (e.g. `foo` in `f(foo: 0);`. |
243 static const namedArgumentReference = | 243 static const namedArgumentReference = |
244 const IdentifierContext._('namedArgumentReference'); | 244 const IdentifierContext._('namedArgumentReference'); |
245 | 245 |
246 /// Identifier is a name being declared by a local variable declaration. | 246 /// Identifier is a name being declared by a local variable declaration. |
247 static const localVariableDeclaration = const IdentifierContext._( | 247 static const localVariableDeclaration = const IdentifierContext._( |
248 'localVariableDeclaration', | 248 'localVariableDeclaration', |
249 inDeclaration: true); | 249 inDeclaration: true); |
250 | 250 |
251 /// Identifier is a reference to a label (e.g. `foo` in `break foo;`). | 251 /// Identifier is a reference to a label (e.g. `foo` in `break foo;`). |
252 static const labelReference = | 252 /// Labels have their own scope. |
253 const IdentifierContext._('labelReference', isScopeReference: true); | 253 static const labelReference = const IdentifierContext._('labelReference'); |
254 | 254 |
255 final String _name; | 255 final String _name; |
256 | 256 |
257 /// Indicates whether the identifier represents a name which is being | 257 /// Indicates whether the identifier represents a name which is being |
258 /// declared. | 258 /// declared. |
259 final bool inDeclaration; | 259 final bool inDeclaration; |
260 | 260 |
261 /// Indicates whether the identifier is within a `library` or `part of` | 261 /// Indicates whether the identifier is within a `library` or `part of` |
262 /// declaration. | 262 /// declaration. |
263 final bool inLibraryOrPartOfDeclaration; | 263 final bool inLibraryOrPartOfDeclaration; |
(...skipping 13 matching lines...) Expand all Loading... |
277 const IdentifierContext._(this._name, | 277 const IdentifierContext._(this._name, |
278 {this.inDeclaration: false, | 278 {this.inDeclaration: false, |
279 this.inLibraryOrPartOfDeclaration: false, | 279 this.inLibraryOrPartOfDeclaration: false, |
280 this.inSymbol: false, | 280 this.inSymbol: false, |
281 this.isContinuation: false, | 281 this.isContinuation: false, |
282 this.isScopeReference: false, | 282 this.isScopeReference: false, |
283 this.isBuiltInIdentifierAllowed: true}); | 283 this.isBuiltInIdentifierAllowed: true}); |
284 | 284 |
285 String toString() => _name; | 285 String toString() => _name; |
286 } | 286 } |
OLD | NEW |