| 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 engine.incremental_resolver; | 5 library engine.incremental_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/context/cache.dart' | 10 import 'package:analyzer/src/context/cache.dart' |
| 11 show CacheEntry, TargetedResult; | 11 show CacheEntry, TargetedResult; |
| 12 import 'package:analyzer/src/generated/constant.dart'; | 12 import 'package:analyzer/src/generated/constant.dart'; |
| 13 import 'package:analyzer/src/task/dart.dart' | 13 import 'package:analyzer/src/task/dart.dart' |
| 14 show | 14 show |
| 15 HINTS, | 15 HINTS, |
| 16 INFER_STATIC_VARIABLE_TYPES_ERRORS, |
| 17 LIBRARY_UNIT_ERRORS, |
| 16 PARSE_ERRORS, | 18 PARSE_ERRORS, |
| 17 RESOLVE_REFERENCES_ERRORS, | 19 PARTIALLY_RESOLVE_REFERENCES_ERRORS, |
| 20 RESOLVE_FUNCTION_BODIES_ERRORS, |
| 18 RESOLVE_TYPE_NAMES_ERRORS, | 21 RESOLVE_TYPE_NAMES_ERRORS, |
| 19 SCAN_ERRORS, | 22 SCAN_ERRORS, |
| 20 USED_IMPORTED_ELEMENTS, | 23 USED_IMPORTED_ELEMENTS, |
| 21 USED_LOCAL_ELEMENTS, | 24 USED_LOCAL_ELEMENTS, |
| 22 VARIABLE_REFERENCE_ERRORS, | 25 VARIABLE_REFERENCE_ERRORS, |
| 23 VERIFY_ERRORS; | 26 VERIFY_ERRORS; |
| 24 import 'package:analyzer/task/dart.dart' | 27 import 'package:analyzer/task/dart.dart' |
| 25 show DART_ERRORS, LibrarySpecificUnit, PARSED_UNIT, TOKEN_STREAM; | 28 show DART_ERRORS, LibrarySpecificUnit, PARSED_UNIT, TOKEN_STREAM; |
| 26 import 'package:analyzer/task/general.dart' show CONTENT, LINE_INFO; | 29 import 'package:analyzer/task/general.dart' show CONTENT, LINE_INFO; |
| 27 import 'package:analyzer/task/model.dart' show ResultDescriptor, TargetedResult; | 30 import 'package:analyzer/task/model.dart' show ResultDescriptor, TargetedResult; |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 void _shiftEntryErrors() { | 1121 void _shiftEntryErrors() { |
| 1119 if (oldEntry != null) { | 1122 if (oldEntry != null) { |
| 1120 _shiftEntryErrors_OLD(); | 1123 _shiftEntryErrors_OLD(); |
| 1121 } else { | 1124 } else { |
| 1122 _shiftEntryErrors_NEW(); | 1125 _shiftEntryErrors_NEW(); |
| 1123 } | 1126 } |
| 1124 } | 1127 } |
| 1125 | 1128 |
| 1126 void _shiftEntryErrors_NEW() { | 1129 void _shiftEntryErrors_NEW() { |
| 1127 _shiftErrors_NEW(HINTS); | 1130 _shiftErrors_NEW(HINTS); |
| 1128 _shiftErrors_NEW(RESOLVE_REFERENCES_ERRORS); | 1131 _shiftErrors_NEW(INFER_STATIC_VARIABLE_TYPES_ERRORS); |
| 1132 _shiftErrors_NEW(LIBRARY_UNIT_ERRORS); |
| 1133 _shiftErrors_NEW(PARTIALLY_RESOLVE_REFERENCES_ERRORS); |
| 1134 _shiftErrors_NEW(RESOLVE_FUNCTION_BODIES_ERRORS); |
| 1129 _shiftErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS); | 1135 _shiftErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS); |
| 1130 _shiftErrors_NEW(VARIABLE_REFERENCE_ERRORS); | 1136 _shiftErrors_NEW(VARIABLE_REFERENCE_ERRORS); |
| 1131 _shiftErrors_NEW(VERIFY_ERRORS); | 1137 _shiftErrors_NEW(VERIFY_ERRORS); |
| 1132 } | 1138 } |
| 1133 | 1139 |
| 1134 void _shiftEntryErrors_OLD() { | 1140 void _shiftEntryErrors_OLD() { |
| 1135 _shiftErrors_OLD(DartEntry.RESOLUTION_ERRORS); | 1141 _shiftErrors_OLD(DartEntry.RESOLUTION_ERRORS); |
| 1136 _shiftErrors_OLD(DartEntry.VERIFICATION_ERRORS); | 1142 _shiftErrors_OLD(DartEntry.VERIFICATION_ERRORS); |
| 1137 _shiftErrors_OLD(DartEntry.HINTS); | 1143 _shiftErrors_OLD(DartEntry.HINTS); |
| 1138 _shiftErrors_OLD(DartEntry.LINTS); | 1144 _shiftErrors_OLD(DartEntry.LINTS); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 | 1176 |
| 1171 void _updateEntry() { | 1177 void _updateEntry() { |
| 1172 if (oldEntry != null) { | 1178 if (oldEntry != null) { |
| 1173 _updateEntry_OLD(); | 1179 _updateEntry_OLD(); |
| 1174 } else { | 1180 } else { |
| 1175 _updateEntry_NEW(); | 1181 _updateEntry_NEW(); |
| 1176 } | 1182 } |
| 1177 } | 1183 } |
| 1178 | 1184 |
| 1179 void _updateEntry_NEW() { | 1185 void _updateEntry_NEW() { |
| 1180 _updateErrors_NEW(RESOLVE_REFERENCES_ERRORS, _resolveErrors); | 1186 _updateErrors_NEW(INFER_STATIC_VARIABLE_TYPES_ERRORS, _resolveErrors); |
| 1187 _updateErrors_NEW(LIBRARY_UNIT_ERRORS, _resolveErrors); |
| 1188 _updateErrors_NEW(PARTIALLY_RESOLVE_REFERENCES_ERRORS, _resolveErrors); |
| 1189 _updateErrors_NEW(RESOLVE_FUNCTION_BODIES_ERRORS, _resolveErrors); |
| 1181 _updateErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS, []); | 1190 _updateErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS, []); |
| 1182 _updateErrors_NEW(VARIABLE_REFERENCE_ERRORS, []); | 1191 _updateErrors_NEW(VARIABLE_REFERENCE_ERRORS, []); |
| 1183 _updateErrors_NEW(VERIFY_ERRORS, _verifyErrors); | 1192 _updateErrors_NEW(VERIFY_ERRORS, _verifyErrors); |
| 1184 // invalidate results we don't update incrementally | 1193 // invalidate results we don't update incrementally |
| 1185 newUnitEntry.setState(USED_IMPORTED_ELEMENTS, CacheState.INVALID); | 1194 newUnitEntry.setState(USED_IMPORTED_ELEMENTS, CacheState.INVALID); |
| 1186 newUnitEntry.setState(USED_LOCAL_ELEMENTS, CacheState.INVALID); | 1195 newUnitEntry.setState(USED_LOCAL_ELEMENTS, CacheState.INVALID); |
| 1187 newUnitEntry.setState(HINTS, CacheState.INVALID); | 1196 newUnitEntry.setState(HINTS, CacheState.INVALID); |
| 1188 } | 1197 } |
| 1189 | 1198 |
| 1190 void _updateEntry_OLD() { | 1199 void _updateEntry_OLD() { |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2015 @override | 2024 @override |
| 2016 String toString() => name; | 2025 String toString() => name; |
| 2017 } | 2026 } |
| 2018 | 2027 |
| 2019 class _TokenPair { | 2028 class _TokenPair { |
| 2020 final _TokenDifferenceKind kind; | 2029 final _TokenDifferenceKind kind; |
| 2021 final Token oldToken; | 2030 final Token oldToken; |
| 2022 final Token newToken; | 2031 final Token newToken; |
| 2023 _TokenPair(this.kind, this.oldToken, this.newToken); | 2032 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 2024 } | 2033 } |
| OLD | NEW |