| 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' |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 } | 1091 } |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 _resolveReferences(AstNode node) { | 1094 _resolveReferences(AstNode node) { |
| 1095 LoggingTimer timer = logger.startTimer(); | 1095 LoggingTimer timer = logger.startTimer(); |
| 1096 try { | 1096 try { |
| 1097 _prepareResolutionContext(node); | 1097 _prepareResolutionContext(node); |
| 1098 Scope scope = _resolutionContext.scope; | 1098 Scope scope = _resolutionContext.scope; |
| 1099 // resolve types | 1099 // resolve types |
| 1100 { | 1100 { |
| 1101 TypeResolverVisitor visitor = new TypeResolverVisitor.con3( | 1101 TypeResolverVisitor visitor = new TypeResolverVisitor( |
| 1102 _definingLibrary, _source, _typeProvider, scope, errorListener); | 1102 _definingLibrary, _source, _typeProvider, errorListener, |
| 1103 nameScope: scope); |
| 1103 node.accept(visitor); | 1104 node.accept(visitor); |
| 1104 } | 1105 } |
| 1105 // resolve variables | 1106 // resolve variables |
| 1106 { | 1107 { |
| 1107 VariableResolverVisitor visitor = new VariableResolverVisitor.con2( | 1108 VariableResolverVisitor visitor = new VariableResolverVisitor( |
| 1108 _definingLibrary, _source, _typeProvider, scope, errorListener); | 1109 _definingLibrary, _source, _typeProvider, errorListener, |
| 1110 nameScope: scope); |
| 1109 node.accept(visitor); | 1111 node.accept(visitor); |
| 1110 } | 1112 } |
| 1111 // resolve references | 1113 // resolve references |
| 1112 { | 1114 { |
| 1113 ResolverVisitor visitor = new ResolverVisitor.con3( | 1115 ResolverVisitor visitor = new ResolverVisitor( |
| 1114 _definingLibrary, _source, _typeProvider, scope, errorListener); | 1116 _definingLibrary, _source, _typeProvider, errorListener, |
| 1117 nameScope: scope); |
| 1115 if (_resolutionContext.enclosingClassDeclaration != null) { | 1118 if (_resolutionContext.enclosingClassDeclaration != null) { |
| 1116 visitor.visitClassDeclarationIncrementally( | 1119 visitor.visitClassDeclarationIncrementally( |
| 1117 _resolutionContext.enclosingClassDeclaration); | 1120 _resolutionContext.enclosingClassDeclaration); |
| 1118 } | 1121 } |
| 1119 if (node is Comment) { | 1122 if (node is Comment) { |
| 1120 visitor.resolveOnlyCommentInFunctionBody = true; | 1123 visitor.resolveOnlyCommentInFunctionBody = true; |
| 1121 node = node.parent; | 1124 node = node.parent; |
| 1122 } | 1125 } |
| 1123 visitor.initForIncrementalResolution(); | 1126 visitor.initForIncrementalResolution(); |
| 1124 node.accept(visitor); | 1127 node.accept(visitor); |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2003 @override | 2006 @override |
| 2004 String toString() => name; | 2007 String toString() => name; |
| 2005 } | 2008 } |
| 2006 | 2009 |
| 2007 class _TokenPair { | 2010 class _TokenPair { |
| 2008 final _TokenDifferenceKind kind; | 2011 final _TokenDifferenceKind kind; |
| 2009 final Token oldToken; | 2012 final Token oldToken; |
| 2010 final Token newToken; | 2013 final Token newToken; |
| 2011 _TokenPair(this.kind, this.oldToken, this.newToken); | 2014 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 2012 } | 2015 } |
| OLD | NEW |