summaryrefslogtreecommitdiff
path: root/src/locators
diff options
context:
space:
mode:
Diffstat (limited to 'src/locators')
-rw-r--r--src/locators/source.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/locators/source.rs b/src/locators/source.rs
index 2f10bd9..20542e3 100644
--- a/src/locators/source.rs
+++ b/src/locators/source.rs
@@ -11,6 +11,12 @@ pub struct SourceSpan {
pub in_source: Option<SourceLocation>,
}
+impl SourceSpan {
+ pub fn location(&self) -> &SourceLocation {
+ self.in_source.as_ref().unwrap_or(&self.in_merged)
+ }
+}
+
#[derive(Clone)]
pub struct SourceLocation {