Support basic diagnostic reporting

This commit is contained in:
Ayaz Hafiz 2022-08-20 15:14:59 -05:00
parent c50925240d
commit 9d365a8a57
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
11 changed files with 572 additions and 3 deletions

View file

@ -160,6 +160,13 @@ impl Error {
Error::Unmatchable { .. } => Warning,
}
}
pub fn region(&self) -> Region {
match self {
Error::Incomplete(region, _, _) => *region,
Error::Redundant { branch_region, .. } => *branch_region,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]