| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine; | 8 library engine; |
| 9 | 9 |
| 10 import "dart:math" as math; | 10 import "dart:math" as math; |
| 11 import 'dart:async'; | 11 import 'dart:async'; |
| 12 import 'dart:collection'; | 12 import 'dart:collection'; |
| 13 | 13 |
| 14 import 'package:analyzer/src/task/task_dart.dart'; | 14 import 'package:analyzer/src/task/task_dart.dart'; |
| 15 | 15 |
| 16 import 'ast.dart'; | 16 import 'ast.dart'; |
| 17 import 'constant.dart'; | 17 import 'constant.dart'; |
| 18 import 'element.dart'; | 18 import 'element.dart'; |
| 19 import 'error.dart'; | 19 import 'error.dart'; |
| 20 import 'error_verifier.dart'; | 20 import 'error_verifier.dart'; |
| 21 import 'html.dart' as ht; | 21 import 'html.dart' as ht; |
| 22 import 'incremental_scanner.dart'; | 22 import 'incremental_scanner.dart'; |
| 23 import 'incremental_resolver.dart' show IncrementalResolver, | 23 import 'incremental_resolver.dart' show IncrementalResolver, |
| 24 poorMansIncrementalResolution; | 24 PoorMansIncrementalResolver; |
| 25 import 'instrumentation.dart'; | 25 import 'instrumentation.dart'; |
| 26 import 'java_core.dart'; | 26 import 'java_core.dart'; |
| 27 import 'java_engine.dart'; | 27 import 'java_engine.dart'; |
| 28 import 'parser.dart' show Parser, IncrementalParser; | 28 import 'parser.dart' show Parser, IncrementalParser; |
| 29 import 'resolver.dart'; | 29 import 'resolver.dart'; |
| 30 import 'scanner.dart'; | 30 import 'scanner.dart'; |
| 31 import 'sdk.dart' show DartSdk; | 31 import 'sdk.dart' show DartSdk; |
| 32 import 'source.dart'; | 32 import 'source.dart'; |
| 33 import 'utilities_collection.dart'; | 33 import 'utilities_collection.dart'; |
| 34 import 'utilities_general.dart'; | 34 import 'utilities_general.dart'; |
| (...skipping 4882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4917 null)); | 4917 null)); |
| 4918 } | 4918 } |
| 4919 _workManager.remove(source); | 4919 _workManager.remove(source); |
| 4920 _removeFromPriorityOrder(source); | 4920 _removeFromPriorityOrder(source); |
| 4921 } | 4921 } |
| 4922 | 4922 |
| 4923 /** | 4923 /** |
| 4924 * TODO(scheglov) A hackish, limited incremental resolution implementation. | 4924 * TODO(scheglov) A hackish, limited incremental resolution implementation. |
| 4925 */ | 4925 */ |
| 4926 bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) { | 4926 bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) { |
| 4927 DartEntry dartEntry = _cache.get(unitSource); |
| 4928 if (dartEntry == null) { |
| 4929 return false; |
| 4930 } |
| 4931 // prepare the (only) library |
| 4927 List<Source> librarySources = getLibrariesContaining(unitSource); | 4932 List<Source> librarySources = getLibrariesContaining(unitSource); |
| 4928 if (librarySources.length != 1) { | 4933 if (librarySources.length != 1) { |
| 4929 return false; | 4934 return false; |
| 4930 } | 4935 } |
| 4936 // do resolution |
| 4937 Source librarySource = librarySources[0]; |
| 4931 CompilationUnit oldUnit = | 4938 CompilationUnit oldUnit = |
| 4932 getResolvedCompilationUnit2(unitSource, librarySources[0]); | 4939 getResolvedCompilationUnit2(unitSource, librarySource); |
| 4933 bool success = poorMansIncrementalResolution(typeProvider, oldUnit, newCode)
; | 4940 PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver( |
| 4941 typeProvider, |
| 4942 unitSource, |
| 4943 librarySource, |
| 4944 dartEntry); |
| 4945 bool success = resolver.resolve(oldUnit, newCode); |
| 4934 if (!success) { | 4946 if (!success) { |
| 4935 return false; | 4947 return false; |
| 4936 } | 4948 } |
| 4949 // prepare notice |
| 4937 ChangeNoticeImpl notice = _getNotice(unitSource); | 4950 ChangeNoticeImpl notice = _getNotice(unitSource); |
| 4938 notice.compilationUnit = oldUnit; | 4951 notice.compilationUnit = oldUnit; |
| 4939 // TODO(scheglov) apply updated errors | 4952 // TODO(scheglov) apply updated errors |
| 4940 { | 4953 { |
| 4941 LineInfo lineInfo = getLineInfo(unitSource); | 4954 LineInfo lineInfo = getLineInfo(unitSource); |
| 4942 DartEntry dartEntry = _cache.get(unitSource); | |
| 4943 notice.setErrors(dartEntry.allErrors, lineInfo); | 4955 notice.setErrors(dartEntry.allErrors, lineInfo); |
| 4944 } | 4956 } |
| 4945 return true; | 4957 return true; |
| 4946 } | 4958 } |
| 4947 | 4959 |
| 4948 /** | 4960 /** |
| 4949 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. | 4961 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. |
| 4950 * | 4962 * |
| 4951 * @param source the source that has been removed | 4963 * @param source the source that has been removed |
| 4952 */ | 4964 */ |
| (...skipping 5504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10457 cache.offset, | 10469 cache.offset, |
| 10458 cache.offset + cache.oldLength); | 10470 cache.offset + cache.oldLength); |
| 10459 // Update the resolution | 10471 // Update the resolution |
| 10460 TypeProvider typeProvider = this.typeProvider; | 10472 TypeProvider typeProvider = this.typeProvider; |
| 10461 if (_updatedUnit != null && typeProvider != null) { | 10473 if (_updatedUnit != null && typeProvider != null) { |
| 10462 CompilationUnitElement element = _updatedUnit.element; | 10474 CompilationUnitElement element = _updatedUnit.element; |
| 10463 if (element != null) { | 10475 if (element != null) { |
| 10464 LibraryElement library = element.library; | 10476 LibraryElement library = element.library; |
| 10465 if (library != null) { | 10477 if (library != null) { |
| 10466 IncrementalResolver resolver = new IncrementalResolver( | 10478 IncrementalResolver resolver = new IncrementalResolver( |
| 10467 errorListener, | |
| 10468 typeProvider, | 10479 typeProvider, |
| 10469 library, | 10480 library, |
| 10470 element, | 10481 element, |
| 10471 cache.source, | 10482 cache.source, |
| 10472 cache.offset, | 10483 cache.offset, |
| 10473 cache.oldLength, | 10484 cache.oldLength, |
| 10474 cache.newLength); | 10485 cache.newLength); |
| 10475 resolver.resolve(parser.updatedNode); | 10486 resolver.resolve(parser.updatedNode); |
| 10476 } | 10487 } |
| 10477 } | 10488 } |
| (...skipping 4379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14857 | 14868 |
| 14858 @override | 14869 @override |
| 14859 Object visitPolymerTagDartElement(PolymerTagDartElement element) { | 14870 Object visitPolymerTagDartElement(PolymerTagDartElement element) { |
| 14860 if (element.name == PolymerHtmlUnitBuilder_this._elementName) { | 14871 if (element.name == PolymerHtmlUnitBuilder_this._elementName) { |
| 14861 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError( | 14872 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError( |
| 14862 element as PolymerTagDartElementImpl); | 14873 element as PolymerTagDartElementImpl); |
| 14863 } | 14874 } |
| 14864 return null; | 14875 return null; |
| 14865 } | 14876 } |
| 14866 } | 14877 } |
| OLD | NEW |