Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1329743005: Abstract over the type system. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/instrumentation/instrumentation.dart'; 10 import 'package:analyzer/instrumentation/instrumentation.dart';
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 */ 154 */
155 HashMap<Source, ChangeNoticeImpl> _pendingNotices = 155 HashMap<Source, ChangeNoticeImpl> _pendingNotices =
156 new HashMap<Source, ChangeNoticeImpl>(); 156 new HashMap<Source, ChangeNoticeImpl>();
157 157
158 /** 158 /**
159 * The [TypeProvider] for this context, `null` if not yet created. 159 * The [TypeProvider] for this context, `null` if not yet created.
160 */ 160 */
161 TypeProvider _typeProvider; 161 TypeProvider _typeProvider;
162 162
163 /** 163 /**
164 * The [TypeSystem] for this context, `null` if not yet created.
165 */
166 TypeSystem _typeSystem;
167
168 /**
164 * The controller for sending [SourcesChangedEvent]s. 169 * The controller for sending [SourcesChangedEvent]s.
165 */ 170 */
166 StreamController<SourcesChangedEvent> _onSourcesChangedController; 171 StreamController<SourcesChangedEvent> _onSourcesChangedController;
167 172
168 /** 173 /**
169 * A subscription for a stream of events indicating when files are (and are 174 * A subscription for a stream of events indicating when files are (and are
170 * not) being implicitly analyzed. 175 * not) being implicitly analyzed.
171 */ 176 */
172 StreamController<ImplicitAnalysisEvent> _implicitAnalysisEventsController; 177 StreamController<ImplicitAnalysisEvent> _implicitAnalysisEventsController;
173 178
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 } 479 }
475 480
476 /** 481 /**
477 * Sets the [TypeProvider] for this context. 482 * Sets the [TypeProvider] for this context.
478 */ 483 */
479 void set typeProvider(TypeProvider typeProvider) { 484 void set typeProvider(TypeProvider typeProvider) {
480 _typeProvider = typeProvider; 485 _typeProvider = typeProvider;
481 } 486 }
482 487
483 @override 488 @override
489 TypeSystem get typeSystem {
490 if (_typeSystem == null) {
491 _typeSystem = TypeSystem.create(this);
492 }
493 return _typeSystem;
494 }
495
496 @override
484 void addListener(AnalysisListener listener) { 497 void addListener(AnalysisListener listener) {
485 if (!_listeners.contains(listener)) { 498 if (!_listeners.contains(listener)) {
486 _listeners.add(listener); 499 _listeners.add(listener);
487 } 500 }
488 } 501 }
489 502
490 @override 503 @override
491 void applyAnalysisDelta(AnalysisDelta delta) { 504 void applyAnalysisDelta(AnalysisDelta delta) {
492 ChangeSet changeSet = new ChangeSet(); 505 ChangeSet changeSet = new ChangeSet();
493 delta.analysisLevels.forEach((Source source, AnalysisLevel level) { 506 delta.analysisLevels.forEach((Source source, AnalysisLevel level) {
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 new PendingFuture<T>(_context, target, computeValue); 2109 new PendingFuture<T>(_context, target, computeValue);
2097 if (!pendingFuture.evaluate(entry)) { 2110 if (!pendingFuture.evaluate(entry)) {
2098 _context._pendingFutureTargets 2111 _context._pendingFutureTargets
2099 .putIfAbsent(target, () => <PendingFuture>[]) 2112 .putIfAbsent(target, () => <PendingFuture>[])
2100 .add(pendingFuture); 2113 .add(pendingFuture);
2101 scheduleComputation(); 2114 scheduleComputation();
2102 } 2115 }
2103 return pendingFuture.future; 2116 return pendingFuture.future;
2104 } 2117 }
2105 } 2118 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698