OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 unittest.backend.platform_selector.ast; | 5 library test.backend.platform_selector.ast; |
6 | 6 |
7 import 'package:source_span/source_span.dart'; | 7 import 'package:source_span/source_span.dart'; |
8 | 8 |
9 import 'visitor.dart'; | 9 import 'visitor.dart'; |
10 | 10 |
11 /// The superclass of nodes in the platform selector abstract syntax tree. | 11 /// The superclass of nodes in the platform selector abstract syntax tree. |
12 abstract class Node { | 12 abstract class Node { |
13 /// The span indicating where this node came from. | 13 /// The span indicating where this node came from. |
14 /// | 14 /// |
15 /// This is a [FileSpan] because the nodes are parsed from a single continuous | 15 /// This is a [FileSpan] because the nodes are parsed from a single continuous |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 /// Like [FileSpan.expand], except if [start] and [end] are `null` or from | 133 /// Like [FileSpan.expand], except if [start] and [end] are `null` or from |
134 /// different files it returns `null` rather than throwing an error. | 134 /// different files it returns `null` rather than throwing an error. |
135 FileSpan _expandSafe(FileSpan start, FileSpan end) { | 135 FileSpan _expandSafe(FileSpan start, FileSpan end) { |
136 if (start == null || end == null) return null; | 136 if (start == null || end == null) return null; |
137 if (start.file != end.file) return null; | 137 if (start.file != end.file) return null; |
138 return start.expand(end); | 138 return start.expand(end); |
139 } | 139 } |
OLD | NEW |