| 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/services/lint.dart'; | 13 import 'package:analyzer/src/services/lint.dart'; |
| 14 import 'package:analyzer/src/task/dart.dart' | 14 import 'package:analyzer/src/task/dart.dart' |
| 15 show | 15 show |
| 16 HINTS, | 16 HINTS, |
| 17 PARSE_ERRORS, | 17 PARSE_ERRORS, |
| 18 RESOLVE_REFERENCES_ERRORS, | 18 RESOLVE_REFERENCES_ERRORS, |
| 19 RESOLVE_TYPE_NAMES_ERRORS, | 19 RESOLVE_TYPE_NAMES_ERRORS, |
| 20 SCAN_ERRORS, | 20 SCAN_ERRORS, |
| 21 USED_IMPORTED_ELEMENTS, | 21 USED_IMPORTED_ELEMENTS, |
| 22 USED_LOCAL_ELEMENTS, | 22 USED_LOCAL_ELEMENTS, |
| 23 VERIFY_ERRORS; | 23 VERIFY_ERRORS; |
| 24 import 'package:analyzer/task/dart.dart' | 24 import 'package:analyzer/task/dart.dart' |
| 25 show LibrarySpecificUnit, PARSED_UNIT, TOKEN_STREAM; | 25 show DART_ERRORS, LibrarySpecificUnit, PARSED_UNIT, TOKEN_STREAM; |
| 26 import 'package:analyzer/task/general.dart' show CONTENT; | 26 import 'package:analyzer/task/general.dart' show CONTENT; |
| 27 import 'package:analyzer/task/model.dart' show ResultDescriptor; | 27 import 'package:analyzer/task/model.dart' show ResultDescriptor; |
| 28 | 28 |
| 29 import 'ast.dart'; | 29 import 'ast.dart'; |
| 30 import 'element.dart'; | 30 import 'element.dart'; |
| 31 import 'engine.dart'; | 31 import 'engine.dart'; |
| 32 import 'error.dart'; | 32 import 'error.dart'; |
| 33 import 'error_verifier.dart'; | 33 import 'error_verifier.dart'; |
| 34 import 'incremental_logger.dart' show logger, LoggingTimer; | 34 import 'incremental_logger.dart' show logger, LoggingTimer; |
| 35 import 'java_engine.dart'; | 35 import 'java_engine.dart'; |
| (...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 | 1537 |
| 1538 void _updateEntry() { | 1538 void _updateEntry() { |
| 1539 if (_oldEntry != null) { | 1539 if (_oldEntry != null) { |
| 1540 _updateEntry_OLD(); | 1540 _updateEntry_OLD(); |
| 1541 } else { | 1541 } else { |
| 1542 _updateEntry_NEW(); | 1542 _updateEntry_NEW(); |
| 1543 } | 1543 } |
| 1544 } | 1544 } |
| 1545 | 1545 |
| 1546 void _updateEntry_NEW() { | 1546 void _updateEntry_NEW() { |
| 1547 _newSourceEntry.setState(DART_ERRORS, CacheState.INVALID); |
| 1547 // scan results | 1548 // scan results |
| 1548 _newSourceEntry.setState(SCAN_ERRORS, CacheState.INVALID); | 1549 _newSourceEntry.setState(SCAN_ERRORS, CacheState.INVALID); |
| 1549 List<TargetedResult> scanDeps = | 1550 List<TargetedResult> scanDeps = |
| 1550 <TargetedResult>[new TargetedResult(_unitSource, CONTENT)]; | 1551 <TargetedResult>[new TargetedResult(_unitSource, CONTENT)]; |
| 1551 _newSourceEntry.setValue(SCAN_ERRORS, _newScanErrors, scanDeps); | 1552 _newSourceEntry.setValue(SCAN_ERRORS, _newScanErrors, scanDeps); |
| 1552 // parse results | 1553 // parse results |
| 1553 List<TargetedResult> parseDeps = | 1554 List<TargetedResult> parseDeps = |
| 1554 <TargetedResult>[new TargetedResult(_unitSource, TOKEN_STREAM)]; | 1555 <TargetedResult>[new TargetedResult(_unitSource, TOKEN_STREAM)]; |
| 1555 _newSourceEntry.setState(PARSE_ERRORS, CacheState.INVALID); | 1556 _newSourceEntry.setState(PARSE_ERRORS, CacheState.INVALID); |
| 1556 _newSourceEntry.setValue(PARSE_ERRORS, _newParseErrors, parseDeps); | 1557 _newSourceEntry.setValue(PARSE_ERRORS, _newParseErrors, parseDeps); |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1963 @override | 1964 @override |
| 1964 String toString() => name; | 1965 String toString() => name; |
| 1965 } | 1966 } |
| 1966 | 1967 |
| 1967 class _TokenPair { | 1968 class _TokenPair { |
| 1968 final _TokenDifferenceKind kind; | 1969 final _TokenDifferenceKind kind; |
| 1969 final Token oldToken; | 1970 final Token oldToken; |
| 1970 final Token newToken; | 1971 final Token newToken; |
| 1971 _TokenPair(this.kind, this.oldToken, this.newToken); | 1972 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 1972 } | 1973 } |
| OLD | NEW |