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 analyzer.src.generated.incremental_resolver; | 5 library analyzer.src.generated.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/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 } | 288 } |
289 } | 289 } |
290 | 290 |
291 /** | 291 /** |
292 * Compute a value for all of the constants in the given [node]. | 292 * Compute a value for all of the constants in the given [node]. |
293 */ | 293 */ |
294 void _computeConstants(AstNode node) { | 294 void _computeConstants(AstNode node) { |
295 // compute values | 295 // compute values |
296 { | 296 { |
297 CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit); | 297 CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit); |
298 ConstantValueComputer computer = new ConstantValueComputer(_context, | 298 ConstantValueComputer computer = new ConstantValueComputer( |
299 _typeProvider, _context.declaredVariables, null, _typeSystem); | 299 _typeProvider, _context.declaredVariables, null, _typeSystem); |
300 computer.add(unit, _source, _librarySource); | 300 computer.add(unit); |
301 computer.computeValues(); | 301 computer.computeValues(); |
302 } | 302 } |
303 // validate | 303 // validate |
304 { | 304 { |
305 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source); | 305 ErrorReporter errorReporter = new ErrorReporter(errorListener, _source); |
306 ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, | 306 ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, |
307 _definingLibrary, _typeProvider, _context.declaredVariables); | 307 _definingLibrary, _typeProvider, _context.declaredVariables); |
308 node.accept(constantVerifier); | 308 node.accept(constantVerifier); |
309 } | 309 } |
310 } | 310 } |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 @override | 1292 @override |
1293 String toString() => name; | 1293 String toString() => name; |
1294 } | 1294 } |
1295 | 1295 |
1296 class _TokenPair { | 1296 class _TokenPair { |
1297 final _TokenDifferenceKind kind; | 1297 final _TokenDifferenceKind kind; |
1298 final Token oldToken; | 1298 final Token oldToken; |
1299 final Token newToken; | 1299 final Token newToken; |
1300 _TokenPair(this.kind, this.oldToken, this.newToken); | 1300 _TokenPair(this.kind, this.oldToken, this.newToken); |
1301 } | 1301 } |
OLD | NEW |