| 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; |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 | 1056 |
| 1057 @override | 1057 @override |
| 1058 AnalysisOptions get analysisOptions => _options; | 1058 AnalysisOptions get analysisOptions => _options; |
| 1059 | 1059 |
| 1060 @override | 1060 @override |
| 1061 void set analysisOptions(AnalysisOptions options) { | 1061 void set analysisOptions(AnalysisOptions options) { |
| 1062 bool needsRecompute = | 1062 bool needsRecompute = |
| 1063 this._options.analyzeAngular != options.analyzeAngular || | 1063 this._options.analyzeAngular != options.analyzeAngular || |
| 1064 this._options.analyzeFunctionBodies != options.analyzeFunctionBodies || | 1064 this._options.analyzeFunctionBodies != options.analyzeFunctionBodies || |
| 1065 this._options.generateSdkErrors != options.generateSdkErrors || | 1065 this._options.generateSdkErrors != options.generateSdkErrors || |
| 1066 this._options.enableDeferredLoading != options.enableDeferredLoading || | |
| 1067 this._options.enableEnum != options.enableEnum || | |
| 1068 this._options.dart2jsHint != options.dart2jsHint || | 1066 this._options.dart2jsHint != options.dart2jsHint || |
| 1069 (this._options.hint && !options.hint) || | 1067 (this._options.hint && !options.hint) || |
| 1070 this._options.preserveComments != options.preserveComments; | 1068 this._options.preserveComments != options.preserveComments; |
| 1071 int cacheSize = options.cacheSize; | 1069 int cacheSize = options.cacheSize; |
| 1072 if (this._options.cacheSize != cacheSize) { | 1070 if (this._options.cacheSize != cacheSize) { |
| 1073 this._options.cacheSize = cacheSize; | 1071 this._options.cacheSize = cacheSize; |
| 1074 //cache.setMaxCacheSize(cacheSize); | 1072 //cache.setMaxCacheSize(cacheSize); |
| 1075 _privatePartition.maxCacheSize = cacheSize; | 1073 _privatePartition.maxCacheSize = cacheSize; |
| 1076 // | 1074 // |
| 1077 // Cap the size of the priority list to being less than the cache size. | 1075 // Cap the size of the priority list to being less than the cache size. |
| 1078 // Failure to do so can result in an infinite loop in | 1076 // Failure to do so can result in an infinite loop in |
| 1079 // performAnalysisTask() because re-caching one AST structure | 1077 // performAnalysisTask() because re-caching one AST structure |
| 1080 // can cause another priority source's AST structure to be flushed. | 1078 // can cause another priority source's AST structure to be flushed. |
| 1081 // | 1079 // |
| 1082 int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA; | 1080 int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA; |
| 1083 if (_priorityOrder.length > maxPriorityOrderSize) { | 1081 if (_priorityOrder.length > maxPriorityOrderSize) { |
| 1084 List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize); | 1082 List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize); |
| 1085 JavaSystem.arraycopy( | 1083 JavaSystem.arraycopy( |
| 1086 _priorityOrder, | 1084 _priorityOrder, |
| 1087 0, | 1085 0, |
| 1088 newPriorityOrder, | 1086 newPriorityOrder, |
| 1089 0, | 1087 0, |
| 1090 maxPriorityOrderSize); | 1088 maxPriorityOrderSize); |
| 1091 _priorityOrder = newPriorityOrder; | 1089 _priorityOrder = newPriorityOrder; |
| 1092 } | 1090 } |
| 1093 } | 1091 } |
| 1094 this._options.analyzeAngular = options.analyzeAngular; | 1092 this._options.analyzeAngular = options.analyzeAngular; |
| 1095 this._options.analyzeFunctionBodies = options.analyzeFunctionBodies; | 1093 this._options.analyzeFunctionBodies = options.analyzeFunctionBodies; |
| 1096 this._options.generateSdkErrors = options.generateSdkErrors; | 1094 this._options.generateSdkErrors = options.generateSdkErrors; |
| 1097 this._options.enableDeferredLoading = options.enableDeferredLoading; | |
| 1098 this._options.enableEnum = options.enableEnum; | |
| 1099 this._options.dart2jsHint = options.dart2jsHint; | 1095 this._options.dart2jsHint = options.dart2jsHint; |
| 1100 this._options.hint = options.hint; | 1096 this._options.hint = options.hint; |
| 1101 this._options.incremental = options.incremental; | 1097 this._options.incremental = options.incremental; |
| 1102 this._options.incrementalApi = options.incrementalApi; | 1098 this._options.incrementalApi = options.incrementalApi; |
| 1103 this._options.incrementalValidation = options.incrementalValidation; | 1099 this._options.incrementalValidation = options.incrementalValidation; |
| 1104 this._options.preserveComments = options.preserveComments; | 1100 this._options.preserveComments = options.preserveComments; |
| 1105 _generateSdkErrors = options.generateSdkErrors; | 1101 _generateSdkErrors = options.generateSdkErrors; |
| 1106 if (needsRecompute) { | 1102 if (needsRecompute) { |
| 1107 _invalidateAllLocalResolutionInformation(false); | 1103 _invalidateAllLocalResolutionInformation(false); |
| 1108 } | 1104 } |
| (...skipping 4763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5872 */ | 5868 */ |
| 5873 List<AnalysisContextStatistics_PartitionData> get partitionData; | 5869 List<AnalysisContextStatistics_PartitionData> get partitionData; |
| 5874 | 5870 |
| 5875 /** | 5871 /** |
| 5876 * Return an array containing all of the sources in the cache. | 5872 * Return an array containing all of the sources in the cache. |
| 5877 */ | 5873 */ |
| 5878 List<Source> get sources; | 5874 List<Source> get sources; |
| 5879 } | 5875 } |
| 5880 | 5876 |
| 5881 /** | 5877 /** |
| 5882 * Information about single piece of data in the cache. | |
| 5883 */ | |
| 5884 abstract class AnalysisContextStatistics_CacheRow { | |
| 5885 /** | |
| 5886 * List of possible states which can be queried. | |
| 5887 */ | |
| 5888 static const List<CacheState> STATES = const <CacheState>[ | |
| 5889 CacheState.ERROR, | |
| 5890 CacheState.FLUSHED, | |
| 5891 CacheState.IN_PROCESS, | |
| 5892 CacheState.INVALID, | |
| 5893 CacheState.VALID]; | |
| 5894 | |
| 5895 /** | |
| 5896 * Return the number of entries whose state is [CacheState.ERROR]. | |
| 5897 */ | |
| 5898 int get errorCount; | |
| 5899 | |
| 5900 /** | |
| 5901 * Return the number of entries whose state is [CacheState.FLUSHED]. | |
| 5902 */ | |
| 5903 int get flushedCount; | |
| 5904 | |
| 5905 /** | |
| 5906 * Return the number of entries whose state is [CacheState.IN_PROCESS]. | |
| 5907 */ | |
| 5908 int get inProcessCount; | |
| 5909 | |
| 5910 /** | |
| 5911 * Return the number of entries whose state is [CacheState.INVALID]. | |
| 5912 */ | |
| 5913 int get invalidCount; | |
| 5914 | |
| 5915 /** | |
| 5916 * Return the name of the data represented by this object. | |
| 5917 */ | |
| 5918 String get name; | |
| 5919 | |
| 5920 /** | |
| 5921 * Return the number of entries whose state is [CacheState.VALID]. | |
| 5922 */ | |
| 5923 int get validCount; | |
| 5924 | |
| 5925 /** | |
| 5926 * Return the number of entries whose state is [state]. | |
| 5927 */ | |
| 5928 int getCount(CacheState state); | |
| 5929 } | |
| 5930 | |
| 5931 /** | |
| 5932 * Information about a single partition in the cache. | |
| 5933 */ | |
| 5934 abstract class AnalysisContextStatistics_PartitionData { | |
| 5935 /** | |
| 5936 * Return the number of entries in the partition that have an AST structure in
one state or | |
| 5937 * another. | |
| 5938 */ | |
| 5939 int get astCount; | |
| 5940 | |
| 5941 /** | |
| 5942 * Return the total number of entries in the partition. | |
| 5943 */ | |
| 5944 int get totalCount; | |
| 5945 } | |
| 5946 | |
| 5947 /** | |
| 5948 * Implementation of the [AnalysisContextStatistics]. | 5878 * Implementation of the [AnalysisContextStatistics]. |
| 5949 */ | 5879 */ |
| 5950 class AnalysisContextStatisticsImpl implements AnalysisContextStatistics { | 5880 class AnalysisContextStatisticsImpl implements AnalysisContextStatistics { |
| 5951 Map<String, AnalysisContextStatistics_CacheRow> _dataMap = | 5881 Map<String, AnalysisContextStatistics_CacheRow> _dataMap = |
| 5952 new HashMap<String, AnalysisContextStatistics_CacheRow>(); | 5882 new HashMap<String, AnalysisContextStatistics_CacheRow>(); |
| 5953 | 5883 |
| 5954 List<Source> _sources = new List<Source>(); | 5884 List<Source> _sources = new List<Source>(); |
| 5955 | 5885 |
| 5956 HashSet<CaughtException> _exceptions = new HashSet<CaughtException>(); | 5886 HashSet<CaughtException> _exceptions = new HashSet<CaughtException>(); |
| 5957 | 5887 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6054 AnalysisContextStatistics_PartitionData { | 5984 AnalysisContextStatistics_PartitionData { |
| 6055 final int astCount; | 5985 final int astCount; |
| 6056 | 5986 |
| 6057 final int totalCount; | 5987 final int totalCount; |
| 6058 | 5988 |
| 6059 AnalysisContextStatisticsImpl_PartitionDataImpl(this.astCount, | 5989 AnalysisContextStatisticsImpl_PartitionDataImpl(this.astCount, |
| 6060 this.totalCount); | 5990 this.totalCount); |
| 6061 } | 5991 } |
| 6062 | 5992 |
| 6063 /** | 5993 /** |
| 5994 * Information about single piece of data in the cache. |
| 5995 */ |
| 5996 abstract class AnalysisContextStatistics_CacheRow { |
| 5997 /** |
| 5998 * List of possible states which can be queried. |
| 5999 */ |
| 6000 static const List<CacheState> STATES = const <CacheState>[ |
| 6001 CacheState.ERROR, |
| 6002 CacheState.FLUSHED, |
| 6003 CacheState.IN_PROCESS, |
| 6004 CacheState.INVALID, |
| 6005 CacheState.VALID]; |
| 6006 |
| 6007 /** |
| 6008 * Return the number of entries whose state is [CacheState.ERROR]. |
| 6009 */ |
| 6010 int get errorCount; |
| 6011 |
| 6012 /** |
| 6013 * Return the number of entries whose state is [CacheState.FLUSHED]. |
| 6014 */ |
| 6015 int get flushedCount; |
| 6016 |
| 6017 /** |
| 6018 * Return the number of entries whose state is [CacheState.IN_PROCESS]. |
| 6019 */ |
| 6020 int get inProcessCount; |
| 6021 |
| 6022 /** |
| 6023 * Return the number of entries whose state is [CacheState.INVALID]. |
| 6024 */ |
| 6025 int get invalidCount; |
| 6026 |
| 6027 /** |
| 6028 * Return the name of the data represented by this object. |
| 6029 */ |
| 6030 String get name; |
| 6031 |
| 6032 /** |
| 6033 * Return the number of entries whose state is [CacheState.VALID]. |
| 6034 */ |
| 6035 int get validCount; |
| 6036 |
| 6037 /** |
| 6038 * Return the number of entries whose state is [state]. |
| 6039 */ |
| 6040 int getCount(CacheState state); |
| 6041 } |
| 6042 |
| 6043 /** |
| 6044 * Information about a single partition in the cache. |
| 6045 */ |
| 6046 abstract class AnalysisContextStatistics_PartitionData { |
| 6047 /** |
| 6048 * Return the number of entries in the partition that have an AST structure in
one state or |
| 6049 * another. |
| 6050 */ |
| 6051 int get astCount; |
| 6052 |
| 6053 /** |
| 6054 * Return the total number of entries in the partition. |
| 6055 */ |
| 6056 int get totalCount; |
| 6057 } |
| 6058 |
| 6059 /** |
| 6064 * Instances of the class `AnalysisDelta` indicate changes to the types of analy
sis that | 6060 * Instances of the class `AnalysisDelta` indicate changes to the types of analy
sis that |
| 6065 * should be performed. | 6061 * should be performed. |
| 6066 */ | 6062 */ |
| 6067 class AnalysisDelta { | 6063 class AnalysisDelta { |
| 6068 /** | 6064 /** |
| 6069 * A mapping from source to what type of analysis should be performed on that
source. | 6065 * A mapping from source to what type of analysis should be performed on that
source. |
| 6070 */ | 6066 */ |
| 6071 HashMap<Source, AnalysisLevel> _analysisMap = | 6067 HashMap<Source, AnalysisLevel> _analysisMap = |
| 6072 new HashMap<Source, AnalysisLevel>(); | 6068 new HashMap<Source, AnalysisLevel>(); |
| 6073 | 6069 |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6494 * Return `true` if analysis is to include the new async support. | 6490 * Return `true` if analysis is to include the new async support. |
| 6495 */ | 6491 */ |
| 6496 @deprecated | 6492 @deprecated |
| 6497 bool get enableAsync; | 6493 bool get enableAsync; |
| 6498 | 6494 |
| 6499 /** | 6495 /** |
| 6500 * Return `true` if analysis is to include the new deferred loading support. | 6496 * Return `true` if analysis is to include the new deferred loading support. |
| 6501 * | 6497 * |
| 6502 * @return `true` if analysis is to include the new deferred loading support | 6498 * @return `true` if analysis is to include the new deferred loading support |
| 6503 */ | 6499 */ |
| 6500 @deprecated |
| 6504 bool get enableDeferredLoading; | 6501 bool get enableDeferredLoading; |
| 6505 | 6502 |
| 6506 /** | 6503 /** |
| 6507 * Return `true` if analysis is to include the new enum support. | 6504 * Return `true` if analysis is to include the new enum support. |
| 6508 * | 6505 * |
| 6509 * @return `true` if analysis is to include the new enum support | 6506 * @return `true` if analysis is to include the new enum support |
| 6510 */ | 6507 */ |
| 6508 @deprecated |
| 6511 bool get enableEnum; | 6509 bool get enableEnum; |
| 6512 | 6510 |
| 6513 /** | 6511 /** |
| 6514 * Return `true` if errors, warnings and hints should be generated for sources
in the SDK. | 6512 * Return `true` if errors, warnings and hints should be generated for sources
in the SDK. |
| 6515 * The default value is `false`. | 6513 * The default value is `false`. |
| 6516 * | 6514 * |
| 6517 * @return `true` if errors, warnings and hints should be generated for the SD
K | 6515 * @return `true` if errors, warnings and hints should be generated for the SD
K |
| 6518 */ | 6516 */ |
| 6519 bool get generateSdkErrors; | 6517 bool get generateSdkErrors; |
| 6520 | 6518 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6559 */ | 6557 */ |
| 6560 class AnalysisOptionsImpl implements AnalysisOptions { | 6558 class AnalysisOptionsImpl implements AnalysisOptions { |
| 6561 /** | 6559 /** |
| 6562 * The maximum number of sources for which data should be kept in the cache. | 6560 * The maximum number of sources for which data should be kept in the cache. |
| 6563 */ | 6561 */ |
| 6564 static int DEFAULT_CACHE_SIZE = 64; | 6562 static int DEFAULT_CACHE_SIZE = 64; |
| 6565 | 6563 |
| 6566 /** | 6564 /** |
| 6567 * The default value for enabling deferred loading. | 6565 * The default value for enabling deferred loading. |
| 6568 */ | 6566 */ |
| 6567 @deprecated |
| 6569 static bool DEFAULT_ENABLE_DEFERRED_LOADING = true; | 6568 static bool DEFAULT_ENABLE_DEFERRED_LOADING = true; |
| 6570 | 6569 |
| 6571 /** | 6570 /** |
| 6572 * The default value for enabling enum support. | 6571 * The default value for enabling enum support. |
| 6573 */ | 6572 */ |
| 6573 @deprecated |
| 6574 static bool DEFAULT_ENABLE_ENUM = false; | 6574 static bool DEFAULT_ENABLE_ENUM = false; |
| 6575 | 6575 |
| 6576 /** | 6576 /** |
| 6577 * A flag indicating whether analysis is to analyze Angular. | 6577 * A flag indicating whether analysis is to analyze Angular. |
| 6578 */ | 6578 */ |
| 6579 bool analyzeAngular = true; | 6579 bool analyzeAngular = true; |
| 6580 | 6580 |
| 6581 /** | 6581 /** |
| 6582 * A flag indicating whether analysis is to parse and analyze function bodies. | 6582 * A flag indicating whether analysis is to parse and analyze function bodies. |
| 6583 */ | 6583 */ |
| 6584 bool analyzeFunctionBodies = true; | 6584 bool analyzeFunctionBodies = true; |
| 6585 | 6585 |
| 6586 /** | 6586 /** |
| 6587 * A flag indicating whether analysis is to analyze Polymer. | 6587 * A flag indicating whether analysis is to analyze Polymer. |
| 6588 */ | 6588 */ |
| 6589 bool analyzePolymer = true; | 6589 bool analyzePolymer = true; |
| 6590 | 6590 |
| 6591 /** | 6591 /** |
| 6592 * The maximum number of sources for which AST structures should be kept in th
e cache. | 6592 * The maximum number of sources for which AST structures should be kept in th
e cache. |
| 6593 */ | 6593 */ |
| 6594 int cacheSize = DEFAULT_CACHE_SIZE; | 6594 int cacheSize = DEFAULT_CACHE_SIZE; |
| 6595 | 6595 |
| 6596 /** | 6596 /** |
| 6597 * A flag indicating whether analysis is to generate dart2js related hint resu
lts. | 6597 * A flag indicating whether analysis is to generate dart2js related hint resu
lts. |
| 6598 */ | 6598 */ |
| 6599 bool dart2jsHint = true; | 6599 bool dart2jsHint = true; |
| 6600 | 6600 |
| 6601 @deprecated | |
| 6602 @override | |
| 6603 bool get enableAsync => true; | |
| 6604 | |
| 6605 @deprecated | |
| 6606 void set enableAsync(bool enable) { | |
| 6607 // Async support cannot be disabled | |
| 6608 } | |
| 6609 | |
| 6610 /** | |
| 6611 * A flag indicating whether analysis is to enable deferred loading. | |
| 6612 */ | |
| 6613 bool enableDeferredLoading = DEFAULT_ENABLE_DEFERRED_LOADING; | |
| 6614 | |
| 6615 /** | |
| 6616 * A flag indicating whether analysis is to enable enum support. | |
| 6617 */ | |
| 6618 bool enableEnum = DEFAULT_ENABLE_ENUM; | |
| 6619 | |
| 6620 /** | 6601 /** |
| 6621 * A flag indicating whether errors, warnings and hints should be generated fo
r sources in the | 6602 * A flag indicating whether errors, warnings and hints should be generated fo
r sources in the |
| 6622 * SDK. | 6603 * SDK. |
| 6623 */ | 6604 */ |
| 6624 bool _generateSdkErrors = false; | 6605 bool _generateSdkErrors = false; |
| 6625 | 6606 |
| 6626 /** | 6607 /** |
| 6627 * A flag indicating whether analysis is to generate hint results (e.g. type i
nference based | 6608 * A flag indicating whether analysis is to generate hint results (e.g. type i
nference based |
| 6628 * information and pub best practices). | 6609 * information and pub best practices). |
| 6629 */ | 6610 */ |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6661 * given set of analysis options. | 6642 * given set of analysis options. |
| 6662 * | 6643 * |
| 6663 * @param options the analysis options whose values are being copied | 6644 * @param options the analysis options whose values are being copied |
| 6664 */ | 6645 */ |
| 6665 AnalysisOptionsImpl.con1(AnalysisOptions options) { | 6646 AnalysisOptionsImpl.con1(AnalysisOptions options) { |
| 6666 analyzeAngular = options.analyzeAngular; | 6647 analyzeAngular = options.analyzeAngular; |
| 6667 analyzeFunctionBodies = options.analyzeFunctionBodies; | 6648 analyzeFunctionBodies = options.analyzeFunctionBodies; |
| 6668 analyzePolymer = options.analyzePolymer; | 6649 analyzePolymer = options.analyzePolymer; |
| 6669 cacheSize = options.cacheSize; | 6650 cacheSize = options.cacheSize; |
| 6670 dart2jsHint = options.dart2jsHint; | 6651 dart2jsHint = options.dart2jsHint; |
| 6671 enableDeferredLoading = options.enableDeferredLoading; | |
| 6672 enableEnum = options.enableEnum; | |
| 6673 _generateSdkErrors = options.generateSdkErrors; | 6652 _generateSdkErrors = options.generateSdkErrors; |
| 6674 hint = options.hint; | 6653 hint = options.hint; |
| 6675 incremental = options.incremental; | 6654 incremental = options.incremental; |
| 6676 incrementalApi = options.incrementalApi; | 6655 incrementalApi = options.incrementalApi; |
| 6677 incrementalValidation = options.incrementalValidation; | 6656 incrementalValidation = options.incrementalValidation; |
| 6678 preserveComments = options.preserveComments; | 6657 preserveComments = options.preserveComments; |
| 6679 } | 6658 } |
| 6680 | 6659 |
| 6660 @deprecated |
| 6661 @override |
| 6662 bool get enableAsync => true; |
| 6663 |
| 6664 @deprecated |
| 6665 void set enableAsync(bool enable) { |
| 6666 // Async support cannot be disabled |
| 6667 } |
| 6668 |
| 6669 @deprecated |
| 6670 @override |
| 6671 bool get enableDeferredLoading => true; |
| 6672 |
| 6673 @deprecated |
| 6674 void set enableDeferredLoading(bool enable) { |
| 6675 // Deferred loading support cannot be disabled |
| 6676 } |
| 6677 |
| 6678 @deprecated |
| 6679 @override |
| 6680 bool get enableEnum => true; |
| 6681 |
| 6682 @deprecated |
| 6683 void set enableEnum(bool enable) { |
| 6684 // Enum support cannot be disabled |
| 6685 } |
| 6686 |
| 6681 @override | 6687 @override |
| 6682 bool get generateSdkErrors => _generateSdkErrors; | 6688 bool get generateSdkErrors => _generateSdkErrors; |
| 6683 | 6689 |
| 6684 /** | 6690 /** |
| 6685 * Set whether errors, warnings and hints should be generated for sources in t
he SDK to match the | 6691 * Set whether errors, warnings and hints should be generated for sources in t
he SDK to match the |
| 6686 * given value. | 6692 * given value. |
| 6687 * | 6693 * |
| 6688 * @param generate `true` if errors, warnings and hints should be generated fo
r sources in | 6694 * @param generate `true` if errors, warnings and hints should be generated fo
r sources in |
| 6689 * the SDK | 6695 * the SDK |
| 6690 */ | 6696 */ |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7944 AstNode node = new NodeLocator.con1(offset).searchWithin(root); | 7950 AstNode node = new NodeLocator.con1(offset).searchWithin(root); |
| 7945 if (node != null) { | 7951 if (node != null) { |
| 7946 Element element = ElementLocator.locate(node); | 7952 Element element = ElementLocator.locate(node); |
| 7947 return new ht.XmlExpression_Reference(element, node.offset, node.length); | 7953 return new ht.XmlExpression_Reference(element, node.offset, node.length); |
| 7948 } | 7954 } |
| 7949 return null; | 7955 return null; |
| 7950 } | 7956 } |
| 7951 } | 7957 } |
| 7952 | 7958 |
| 7953 /** | 7959 /** |
| 7954 * A `CachedResult` is a single analysis result that is stored in a | |
| 7955 * [SourceEntry]. | |
| 7956 */ | |
| 7957 class CachedResult<E> { | |
| 7958 /** | |
| 7959 * The state of the cached value. | |
| 7960 */ | |
| 7961 CacheState state; | |
| 7962 | |
| 7963 /** | |
| 7964 * The value being cached, or `null` if there is no value (for example, when | |
| 7965 * the [state] is [CacheState.INVALID]. | |
| 7966 */ | |
| 7967 E value; | |
| 7968 | |
| 7969 /** | |
| 7970 * Initialize a newly created result holder to represent the value of data | |
| 7971 * described by the given [descriptor]. | |
| 7972 */ | |
| 7973 CachedResult(DataDescriptor descriptor) { | |
| 7974 state = CacheState.INVALID; | |
| 7975 value = descriptor.defaultValue; | |
| 7976 } | |
| 7977 } | |
| 7978 | |
| 7979 /** | |
| 7980 * Instances of the class `CachePartition` implement a single partition in an LR
U cache of | 7960 * Instances of the class `CachePartition` implement a single partition in an LR
U cache of |
| 7981 * information related to analysis. | 7961 * information related to analysis. |
| 7982 */ | 7962 */ |
| 7983 abstract class CachePartition { | 7963 abstract class CachePartition { |
| 7984 /** | 7964 /** |
| 7985 * The context that owns this partition. Multiple contexts can reference a par
tition, but only one | 7965 * The context that owns this partition. Multiple contexts can reference a par
tition, but only one |
| 7986 * context can own it. | 7966 * context can own it. |
| 7987 */ | 7967 */ |
| 7988 final InternalAnalysisContext context; | 7968 final InternalAnalysisContext context; |
| 7989 | 7969 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8290 ERROR, | 8270 ERROR, |
| 8291 FLUSHED, | 8271 FLUSHED, |
| 8292 IN_PROCESS, | 8272 IN_PROCESS, |
| 8293 INVALID, | 8273 INVALID, |
| 8294 VALID]; | 8274 VALID]; |
| 8295 | 8275 |
| 8296 const CacheState(String name, int ordinal) : super(name, ordinal); | 8276 const CacheState(String name, int ordinal) : super(name, ordinal); |
| 8297 } | 8277 } |
| 8298 | 8278 |
| 8299 /** | 8279 /** |
| 8280 * A `CachedResult` is a single analysis result that is stored in a |
| 8281 * [SourceEntry]. |
| 8282 */ |
| 8283 class CachedResult<E> { |
| 8284 /** |
| 8285 * The state of the cached value. |
| 8286 */ |
| 8287 CacheState state; |
| 8288 |
| 8289 /** |
| 8290 * The value being cached, or `null` if there is no value (for example, when |
| 8291 * the [state] is [CacheState.INVALID]. |
| 8292 */ |
| 8293 E value; |
| 8294 |
| 8295 /** |
| 8296 * Initialize a newly created result holder to represent the value of data |
| 8297 * described by the given [descriptor]. |
| 8298 */ |
| 8299 CachedResult(DataDescriptor descriptor) { |
| 8300 state = CacheState.INVALID; |
| 8301 value = descriptor.defaultValue; |
| 8302 } |
| 8303 } |
| 8304 |
| 8305 /** |
| 8300 * The interface `ChangeNotice` defines the behavior of objects that represent a
change to the | 8306 * The interface `ChangeNotice` defines the behavior of objects that represent a
change to the |
| 8301 * analysis results associated with a given source. | 8307 * analysis results associated with a given source. |
| 8302 */ | 8308 */ |
| 8303 abstract class ChangeNotice implements AnalysisErrorInfo { | 8309 abstract class ChangeNotice implements AnalysisErrorInfo { |
| 8304 /** | 8310 /** |
| 8305 * Return the fully resolved AST that changed as a result of the analysis, or
`null` if the | 8311 * Return the fully resolved AST that changed as a result of the analysis, or
`null` if the |
| 8306 * AST was not changed. | 8312 * AST was not changed. |
| 8307 * | 8313 * |
| 8308 * @return the fully resolved AST that changed as a result of the analysis | 8314 * @return the fully resolved AST that changed as a result of the analysis |
| 8309 */ | 8315 */ |
| (...skipping 3022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11332 // | 11338 // |
| 11333 // Then parse the token stream. | 11339 // Then parse the token stream. |
| 11334 // | 11340 // |
| 11335 TimeCounter_TimeCounterHandle timeCounterParse = | 11341 TimeCounter_TimeCounterHandle timeCounterParse = |
| 11336 PerformanceStatistics.parse.start(); | 11342 PerformanceStatistics.parse.start(); |
| 11337 try { | 11343 try { |
| 11338 RecordingErrorListener errorListener = new RecordingErrorListener(); | 11344 RecordingErrorListener errorListener = new RecordingErrorListener(); |
| 11339 Parser parser = new Parser(source, errorListener); | 11345 Parser parser = new Parser(source, errorListener); |
| 11340 AnalysisOptions options = context.analysisOptions; | 11346 AnalysisOptions options = context.analysisOptions; |
| 11341 parser.parseFunctionBodies = options.analyzeFunctionBodies; | 11347 parser.parseFunctionBodies = options.analyzeFunctionBodies; |
| 11342 parser.parseDeferredLibraries = options.enableDeferredLoading; | |
| 11343 parser.parseEnum = options.enableEnum; | |
| 11344 _unit = parser.parseCompilationUnit(_tokenStream); | 11348 _unit = parser.parseCompilationUnit(_tokenStream); |
| 11345 _unit.lineInfo = lineInfo; | 11349 _unit.lineInfo = lineInfo; |
| 11346 AnalysisContext analysisContext = context; | 11350 AnalysisContext analysisContext = context; |
| 11347 for (Directive directive in _unit.directives) { | 11351 for (Directive directive in _unit.directives) { |
| 11348 if (directive is PartOfDirective) { | 11352 if (directive is PartOfDirective) { |
| 11349 _containsPartOfDirective = true; | 11353 _containsPartOfDirective = true; |
| 11350 } else { | 11354 } else { |
| 11351 _containsNonPartOfDirective = true; | 11355 _containsNonPartOfDirective = true; |
| 11352 if (directive is UriBasedDirective) { | 11356 if (directive is UriBasedDirective) { |
| 11353 Source referencedSource = | 11357 Source referencedSource = |
| (...skipping 3081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14435 | 14439 |
| 14436 @override | 14440 @override |
| 14437 Object visitPolymerTagDartElement(PolymerTagDartElement element) { | 14441 Object visitPolymerTagDartElement(PolymerTagDartElement element) { |
| 14438 if (element.name == PolymerHtmlUnitBuilder_this._elementName) { | 14442 if (element.name == PolymerHtmlUnitBuilder_this._elementName) { |
| 14439 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError( | 14443 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError( |
| 14440 element as PolymerTagDartElementImpl); | 14444 element as PolymerTagDartElementImpl); |
| 14441 } | 14445 } |
| 14442 return null; | 14446 return null; |
| 14443 } | 14447 } |
| 14444 } | 14448 } |
| OLD | NEW |