| 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 } | 863 } |
| 864 } | 864 } |
| 865 | 865 |
| 866 void _updateEntry() { | 866 void _updateEntry() { |
| 867 // scan results | 867 // scan results |
| 868 _sourceEntry.setValueIncremental(SCAN_ERRORS, _newScanErrors, true); | 868 _sourceEntry.setValueIncremental(SCAN_ERRORS, _newScanErrors, true); |
| 869 _sourceEntry.setValueIncremental(LINE_INFO, _newLineInfo, false); | 869 _sourceEntry.setValueIncremental(LINE_INFO, _newLineInfo, false); |
| 870 // parse results | 870 // parse results |
| 871 _sourceEntry.setValueIncremental(PARSE_ERRORS, _newParseErrors, true); | 871 _sourceEntry.setValueIncremental(PARSE_ERRORS, _newParseErrors, true); |
| 872 _sourceEntry.setValueIncremental(PARSED_UNIT, _oldUnit, false); | 872 _sourceEntry.setValueIncremental(PARSED_UNIT, _oldUnit, false); |
| 873 // referenced names |
| 874 ReferencedNames referencedNames = new ReferencedNames(_unitSource); |
| 875 new ReferencedNamesBuilder(referencedNames).build(_oldUnit); |
| 876 _sourceEntry.setValueIncremental(REFERENCED_NAMES, referencedNames, false); |
| 873 } | 877 } |
| 874 | 878 |
| 875 /** | 879 /** |
| 876 * Checks if [token] has a balanced number of open and closed curly brackets. | 880 * Checks if [token] has a balanced number of open and closed curly brackets. |
| 877 */ | 881 */ |
| 878 static bool _areCurlyBracketsBalanced(Token token) { | 882 static bool _areCurlyBracketsBalanced(Token token) { |
| 879 int numOpen = _getTokenCount(token, TokenType.OPEN_CURLY_BRACKET); | 883 int numOpen = _getTokenCount(token, TokenType.OPEN_CURLY_BRACKET); |
| 880 int numOpen2 = | 884 int numOpen2 = |
| 881 _getTokenCount(token, TokenType.STRING_INTERPOLATION_EXPRESSION); | 885 _getTokenCount(token, TokenType.STRING_INTERPOLATION_EXPRESSION); |
| 882 int numClosed = _getTokenCount(token, TokenType.CLOSE_CURLY_BRACKET); | 886 int numClosed = _getTokenCount(token, TokenType.CLOSE_CURLY_BRACKET); |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 @override | 1292 @override |
| 1289 String toString() => name; | 1293 String toString() => name; |
| 1290 } | 1294 } |
| 1291 | 1295 |
| 1292 class _TokenPair { | 1296 class _TokenPair { |
| 1293 final _TokenDifferenceKind kind; | 1297 final _TokenDifferenceKind kind; |
| 1294 final Token oldToken; | 1298 final Token oldToken; |
| 1295 final Token newToken; | 1299 final Token newToken; |
| 1296 _TokenPair(this.kind, this.oldToken, this.newToken); | 1300 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 1297 } | 1301 } |
| OLD | NEW |