error about missing return/placeholder should point to end of body
@@ -5,6 +5,16 @@ use std::fmt;
/// file no, start offset, end offset (in bytes)
pub struct Loc(pub usize, pub usize, pub usize);
+impl Loc {
+ pub fn begin(&self) -> Self {
+ Loc(self.0, self.1, self.1)
+ }
+
+ pub fn end(&self) -> Self {
+ Loc(self.0, self.2, self.2)
+ }
+}
+
#[derive(Debug, PartialEq, Clone)]
pub struct Identifier {
pub loc: Loc,
