We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents aafb1e9 + 572f35f commit 787b88cCopy full SHA for 787b88c
2 files changed
rust/ruby-prism/src/lib.rs
@@ -465,6 +465,7 @@ mod tests {
465
466
assert_eq!(slice, "222");
467
assert_eq!(6, location.start);
468
+ assert_eq!(location.start, location.start());
469
assert_eq!(9, location.end());
470
471
let recv_loc = plus.receiver().unwrap().location();
rust/ruby-prism/src/parse_result/mod.rs
@@ -44,6 +44,12 @@ impl<'pr> Location<'pr> {
44
}
45
46
47
+ /// Returns the start offset from the beginning of the parsed source.
48
+ #[must_use]
49
+ pub const fn start(&self) -> u32 {
50
+ self.start
51
+ }
52
+
53
/// Returns the end offset from the beginning of the parsed source.
54
#[must_use]
55
pub const fn end(&self) -> u32 {
0 commit comments