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.span; | 5 library source_span.span; |
6 | 6 |
7 import 'location.dart'; | 7 import 'location.dart'; |
8 import 'span_mixin.dart'; | 8 import 'span_mixin.dart'; |
9 | 9 |
10 /// A class that describes a segment of source text. | 10 /// A class that describes a segment of source text. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 throw new ArgumentError("Source URLs \"${start.sourceUrl}\" and " | 69 throw new ArgumentError("Source URLs \"${start.sourceUrl}\" and " |
70 " \"${end.sourceUrl}\" don't match."); | 70 " \"${end.sourceUrl}\" don't match."); |
71 } else if (end.offset < start.offset) { | 71 } else if (end.offset < start.offset) { |
72 throw new ArgumentError('End $end must come after start $start.'); | 72 throw new ArgumentError('End $end must come after start $start.'); |
73 } else if (text.length != start.distance(end)) { | 73 } else if (text.length != start.distance(end)) { |
74 throw new ArgumentError('Text "$text" must be ${start.distance(end)} ' | 74 throw new ArgumentError('Text "$text" must be ${start.distance(end)} ' |
75 'characters long.'); | 75 'characters long.'); |
76 } | 76 } |
77 } | 77 } |
78 } | 78 } |
OLD | NEW |