OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // TODO(jimhug): This should be an interface to work better with tools. | 5 // TODO(jimhug): This should be an interface to work better with tools. |
6 /** | 6 /** |
7 * Represents a file of source code. | 7 * Represents a file of source code. |
8 */ | 8 */ |
9 class SourceFile implements Comparable { | 9 class SourceFile implements Comparable { |
10 // TODO(terry): This filename for in memory buffer. May need to rework if | 10 // TODO(terry): This filename for in memory buffer. May need to rework if |
11 // filename is used for more than informational. | 11 // filename is used for more than informational. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 /** Compares two source spans by file and position. Handles nulls. */ | 178 /** Compares two source spans by file and position. Handles nulls. */ |
179 int compareTo(SourceSpan other) { | 179 int compareTo(SourceSpan other) { |
180 if (file == other.file) { | 180 if (file == other.file) { |
181 int d = start - other.start; | 181 int d = start - other.start; |
182 return d == 0 ? (end - other.end) : d; | 182 return d == 0 ? (end - other.end) : d; |
183 } | 183 } |
184 return file.compareTo(other.file); | 184 return file.compareTo(other.file); |
185 } | 185 } |
186 } | 186 } |
OLD | NEW |