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 source_span.location; | |
6 | |
7 import 'span.dart'; | 5 import 'span.dart'; |
8 | 6 |
9 // TODO(nweiz): Use SourceLocationMixin once we decide to cut a release with | 7 // TODO(nweiz): Use SourceLocationMixin once we decide to cut a release with |
10 // breaking changes. See SourceLocationMixin for details. | 8 // breaking changes. See SourceLocationMixin for details. |
11 | 9 |
12 /// A class that describes a single location within a source file. | 10 /// A class that describes a single location within a source file. |
13 /// | 11 /// |
14 /// This class should not be extended. Instead, [SourceLocationBase] should be | 12 /// This class should not be extended. Instead, [SourceLocationBase] should be |
15 /// extended instead. | 13 /// extended instead. |
16 class SourceLocation implements Comparable<SourceLocation> { | 14 class SourceLocation implements Comparable<SourceLocation> { |
(...skipping 74 matching lines...) Loading... |
91 | 89 |
92 String toString() => '<$runtimeType: $offset $toolString>'; | 90 String toString() => '<$runtimeType: $offset $toolString>'; |
93 } | 91 } |
94 | 92 |
95 /// A base class for source locations with [offset], [line], and [column] known | 93 /// A base class for source locations with [offset], [line], and [column] known |
96 /// at construction time. | 94 /// at construction time. |
97 class SourceLocationBase extends SourceLocation { | 95 class SourceLocationBase extends SourceLocation { |
98 SourceLocationBase(int offset, {sourceUrl, int line, int column}) | 96 SourceLocationBase(int offset, {sourceUrl, int line, int column}) |
99 : super(offset, sourceUrl: sourceUrl, line: line, column: column); | 97 : super(offset, sourceUrl: sourceUrl, line: line, column: column); |
100 } | 98 } |
OLD | NEW |