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 trydart.poi.diff; | 5 library trydart.poi.diff; |
6 | 6 |
7 import 'package:compiler/src/elements/elements.dart' show | 7 import 'package:compiler/src/elements/elements.dart' show |
8 AbstractFieldElement, | 8 AbstractFieldElement, |
9 ClassElement, | 9 ClassElement, |
10 CompilationUnitElement, | 10 CompilationUnitElement, |
11 Element, | 11 Element, |
12 ElementCategory, | 12 ElementCategory, |
13 FunctionElement, | 13 FunctionElement, |
14 LibraryElement, | 14 LibraryElement, |
15 ScopeContainerElement; | 15 ScopeContainerElement; |
16 | 16 |
17 import 'package:compiler/src/elements/modelx.dart' as modelx; | 17 import 'package:compiler/src/elements/modelx.dart' as modelx; |
18 | 18 |
19 import 'package:compiler/src/elements/modelx.dart' show | 19 import 'package:compiler/src/elements/modelx.dart' show |
20 DeclarationSite; | 20 DeclarationSite; |
21 | 21 |
22 import 'package:compiler/src/parser/class_element_parser.dart' show | 22 import 'package:compiler/src/parser/partial_elements.dart' show |
23 PartialClassElement; | 23 PartialClassElement, |
24 | |
25 import 'package:compiler/src/parser/listener.dart' show | |
26 PartialElement; | 24 PartialElement; |
27 | 25 |
28 import 'package:compiler/src/tokens/token.dart' show | 26 import 'package:compiler/src/tokens/token.dart' show |
| 27 ErrorToken, |
| 28 Token; |
| 29 |
| 30 import 'package:compiler/src/tokens/token_constants.dart' show |
29 EOF_TOKEN, | 31 EOF_TOKEN, |
30 ErrorToken, | |
31 IDENTIFIER_TOKEN, | 32 IDENTIFIER_TOKEN, |
32 KEYWORD_TOKEN, | 33 KEYWORD_TOKEN; |
33 Token; | |
34 | 34 |
35 class Difference { | 35 class Difference { |
36 final DeclarationSite before; | 36 final DeclarationSite before; |
37 final DeclarationSite after; | 37 final DeclarationSite after; |
38 | 38 |
39 /// Records the position of first difference between [before] and [after]. If | 39 /// Records the position of first difference between [before] and [after]. If |
40 /// either [before] or [after] are null, [token] is null. | 40 /// either [before] or [after] are null, [token] is null. |
41 Token token; | 41 Token token; |
42 | 42 |
43 Difference(this.before, this.after) { | 43 Difference(this.before, this.after) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 beforeToken = beforeToken.next; | 113 beforeToken = beforeToken.next; |
114 afterToken = afterToken.next; | 114 afterToken = afterToken.next; |
115 beforeKind = beforeToken.kind; | 115 beforeKind = beforeToken.kind; |
116 afterKind = afterToken.kind; | 116 afterKind = afterToken.kind; |
117 } | 117 } |
118 return beforeKind != afterKind; | 118 return beforeKind != afterKind; |
119 } | 119 } |
120 print("$before isn't a PartialElement"); | 120 print("$before isn't a PartialElement"); |
121 return true; | 121 return true; |
122 } | 122 } |
OLD | NEW |