blob: d180a9b2c55493dfe1e2e9c12bbc41ec69da6652 [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart = 2.10
library dart2js.diagnostics.source_span;
import 'spannable.dart' show Spannable;
class SourceSpan implements Spannable {
final Uri uri;
final int begin;
final int end;
const SourceSpan(this.uri, this.begin, this.end);
@override
int get hashCode {
return 13 * uri.hashCode + 17 * begin.hashCode + 19 * end.hashCode;
}
@override
bool operator ==(other) {
if (identical(this, other)) return true;
if (other is! SourceSpan) return false;
return uri == other.uri && begin == other.begin && end == other.end;
}
@override
String toString() => 'SourceSpan($uri, $begin, $end)';
}