| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 4139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4150 return super.uriEnd; | 4150 return super.uriEnd; |
| 4151 } | 4151 } |
| 4152 | 4152 |
| 4153 @override | 4153 @override |
| 4154 void set uriEnd(int uriEnd) { | 4154 void set uriEnd(int uriEnd) { |
| 4155 assert(_unlinkedExportNonPublic == null); | 4155 assert(_unlinkedExportNonPublic == null); |
| 4156 super.uriEnd = uriEnd; | 4156 super.uriEnd = uriEnd; |
| 4157 } | 4157 } |
| 4158 | 4158 |
| 4159 @override | 4159 @override |
| 4160 bool get uriExists { | |
| 4161 if (_unlinkedExportNonPublic != null) { | |
| 4162 return true; | |
| 4163 } | |
| 4164 return hasModifier(Modifier.URI_EXISTS); | |
| 4165 } | |
| 4166 | |
| 4167 /** | |
| 4168 * Set whether the file referenced by the import's URI exists to match the | |
| 4169 * given flag. | |
| 4170 */ | |
| 4171 void set uriExists(bool exists) { | |
| 4172 assert(_unlinkedExportNonPublic == null); | |
| 4173 setModifier(Modifier.URI_EXISTS, exists); | |
| 4174 } | |
| 4175 | |
| 4176 @override | |
| 4177 int get uriOffset { | 4160 int get uriOffset { |
| 4178 if (_unlinkedExportNonPublic != null) { | 4161 if (_unlinkedExportNonPublic != null) { |
| 4179 return _unlinkedExportNonPublic.uriOffset; | 4162 return _unlinkedExportNonPublic.uriOffset; |
| 4180 } | 4163 } |
| 4181 return super.uriOffset; | 4164 return super.uriOffset; |
| 4182 } | 4165 } |
| 4183 | 4166 |
| 4184 @override | 4167 @override |
| 4185 void set uriOffset(int uriOffset) { | 4168 void set uriOffset(int uriOffset) { |
| 4186 assert(_unlinkedExportNonPublic == null); | 4169 assert(_unlinkedExportNonPublic == null); |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5110 return super.uriEnd; | 5093 return super.uriEnd; |
| 5111 } | 5094 } |
| 5112 | 5095 |
| 5113 @override | 5096 @override |
| 5114 void set uriEnd(int uriEnd) { | 5097 void set uriEnd(int uriEnd) { |
| 5115 assert(_unlinkedImport == null); | 5098 assert(_unlinkedImport == null); |
| 5116 super.uriEnd = uriEnd; | 5099 super.uriEnd = uriEnd; |
| 5117 } | 5100 } |
| 5118 | 5101 |
| 5119 @override | 5102 @override |
| 5120 bool get uriExists { | |
| 5121 if (_unlinkedImport != null) { | |
| 5122 return true; | |
| 5123 } | |
| 5124 return hasModifier(Modifier.URI_EXISTS); | |
| 5125 } | |
| 5126 | |
| 5127 /** | |
| 5128 * Set whether the file referenced by the import's URI exists to match the | |
| 5129 * given flag. | |
| 5130 */ | |
| 5131 void set uriExists(bool exists) { | |
| 5132 assert(_unlinkedImport == null); | |
| 5133 setModifier(Modifier.URI_EXISTS, exists); | |
| 5134 } | |
| 5135 | |
| 5136 @override | |
| 5137 int get uriOffset { | 5103 int get uriOffset { |
| 5138 if (_unlinkedImport != null) { | 5104 if (_unlinkedImport != null) { |
| 5139 if (_unlinkedImport.isImplicit) { | 5105 if (_unlinkedImport.isImplicit) { |
| 5140 return -1; | 5106 return -1; |
| 5141 } | 5107 } |
| 5142 return _unlinkedImport.uriOffset; | 5108 return _unlinkedImport.uriOffset; |
| 5143 } | 5109 } |
| 5144 return super.uriOffset; | 5110 return super.uriOffset; |
| 5145 } | 5111 } |
| 5146 | 5112 |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6426 static const Modifier STATIC = const Modifier('STATIC', 15); | 6392 static const Modifier STATIC = const Modifier('STATIC', 15); |
| 6427 | 6393 |
| 6428 /** | 6394 /** |
| 6429 * Indicates that the element does not appear in the source code but was | 6395 * Indicates that the element does not appear in the source code but was |
| 6430 * implicitly created. For example, if a class does not define any | 6396 * implicitly created. For example, if a class does not define any |
| 6431 * constructors, an implicit zero-argument constructor will be created and it | 6397 * constructors, an implicit zero-argument constructor will be created and it |
| 6432 * will be marked as being synthetic. | 6398 * will be marked as being synthetic. |
| 6433 */ | 6399 */ |
| 6434 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 16); | 6400 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 16); |
| 6435 | 6401 |
| 6436 /** | |
| 6437 * A flag used for import and export elements that indicates whether the URI | |
| 6438 * in the corresponding directive referenced a file that exists. | |
| 6439 */ | |
| 6440 static const Modifier URI_EXISTS = const Modifier('URI_EXISTS', 17); | |
| 6441 | |
| 6442 static const List<Modifier> values = const [ | 6402 static const List<Modifier> values = const [ |
| 6443 ABSTRACT, | 6403 ABSTRACT, |
| 6444 ASYNCHRONOUS, | 6404 ASYNCHRONOUS, |
| 6445 CONST, | 6405 CONST, |
| 6446 DEFERRED, | 6406 DEFERRED, |
| 6447 ENUM, | 6407 ENUM, |
| 6448 EXTERNAL, | 6408 EXTERNAL, |
| 6449 FACTORY, | 6409 FACTORY, |
| 6450 FINAL, | 6410 FINAL, |
| 6451 GENERATOR, | 6411 GENERATOR, |
| 6452 GETTER, | 6412 GETTER, |
| 6453 HAS_EXT_URI, | 6413 HAS_EXT_URI, |
| 6454 IMPLICIT_TYPE, | 6414 IMPLICIT_TYPE, |
| 6455 MIXIN_APPLICATION, | 6415 MIXIN_APPLICATION, |
| 6456 REFERENCES_SUPER, | 6416 REFERENCES_SUPER, |
| 6457 SETTER, | 6417 SETTER, |
| 6458 STATIC, | 6418 STATIC, |
| 6459 SYNTHETIC, | 6419 SYNTHETIC |
| 6460 URI_EXISTS | |
| 6461 ]; | 6420 ]; |
| 6462 | 6421 |
| 6463 const Modifier(String name, int ordinal) : super(name, ordinal); | 6422 const Modifier(String name, int ordinal) : super(name, ordinal); |
| 6464 } | 6423 } |
| 6465 | 6424 |
| 6466 /** | 6425 /** |
| 6467 * A concrete implementation of a [MultiplyDefinedElement]. | 6426 * A concrete implementation of a [MultiplyDefinedElement]. |
| 6468 */ | 6427 */ |
| 6469 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { | 6428 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { |
| 6470 /** | 6429 /** |
| (...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8520 | 8479 |
| 8521 @override | 8480 @override |
| 8522 void visitElement(Element element) { | 8481 void visitElement(Element element) { |
| 8523 int offset = element.nameOffset; | 8482 int offset = element.nameOffset; |
| 8524 if (offset != -1) { | 8483 if (offset != -1) { |
| 8525 map[offset] = element; | 8484 map[offset] = element; |
| 8526 } | 8485 } |
| 8527 super.visitElement(element); | 8486 super.visitElement(element); |
| 8528 } | 8487 } |
| 8529 } | 8488 } |
| OLD | NEW |