| 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 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1715 void _setPrecedingComments(Token token, CommentToken comment) { | 1715 void _setPrecedingComments(Token token, CommentToken comment) { |
| 1716 if (token is BeginTokenWithComment) { | 1716 if (token is BeginTokenWithComment) { |
| 1717 token.precedingComments = comment; | 1717 token.precedingComments = comment; |
| 1718 } else if (token is KeywordTokenWithComment) { | 1718 } else if (token is KeywordTokenWithComment) { |
| 1719 token.precedingComments = comment; | 1719 token.precedingComments = comment; |
| 1720 } else if (token is StringTokenWithComment) { | 1720 } else if (token is StringTokenWithComment) { |
| 1721 token.precedingComments = comment; | 1721 token.precedingComments = comment; |
| 1722 } else if (token is TokenWithComment) { | 1722 } else if (token is TokenWithComment) { |
| 1723 token.precedingComments = comment; | 1723 token.precedingComments = comment; |
| 1724 } else { | 1724 } else { |
| 1725 Type parentType = token != null ? token.runtimeType : null; | 1725 Type parentType = token?.runtimeType; |
| 1726 throw new AnalysisException('Uknown parent token type: $parentType'); | 1726 throw new AnalysisException('Uknown parent token type: $parentType'); |
| 1727 } | 1727 } |
| 1728 } | 1728 } |
| 1729 | 1729 |
| 1730 void _shiftTokens(Token token) { | 1730 void _shiftTokens(Token token) { |
| 1731 while (token != null) { | 1731 while (token != null) { |
| 1732 if (token.offset > _updateOffset) { | 1732 if (token.offset > _updateOffset) { |
| 1733 token.offset += _updateDelta; | 1733 token.offset += _updateDelta; |
| 1734 } | 1734 } |
| 1735 // comments | 1735 // comments |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 @override | 2237 @override |
| 2238 String toString() => name; | 2238 String toString() => name; |
| 2239 } | 2239 } |
| 2240 | 2240 |
| 2241 class _TokenPair { | 2241 class _TokenPair { |
| 2242 final _TokenDifferenceKind kind; | 2242 final _TokenDifferenceKind kind; |
| 2243 final Token oldToken; | 2243 final Token oldToken; |
| 2244 final Token newToken; | 2244 final Token newToken; |
| 2245 _TokenPair(this.kind, this.oldToken, this.newToken); | 2245 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 2246 } | 2246 } |
| OLD | NEW |