diff --git a/src/protocol/parser/tokens.rs b/src/protocol/parser/tokens.rs index 107b6a34e08931bb5319971eb0f1f710b44cb668..ccf6982e268efdeaf5a532c9644a6803fd9d148a 100644 --- a/src/protocol/parser/tokens.rs +++ b/src/protocol/parser/tokens.rs @@ -298,6 +298,13 @@ impl<'a> TokenIter<'a> { }; } + /// Assumes the token is not at the end and returns the starting position + /// belonging to the token returned by `next`. + pub(crate) fn next_start_position(&self) -> InputPosition { + debug_assert!(self.cur < self.end); + return self.tokens[self.cur].pos; + } + /// Returns the token range belonging to the token returned by `next`. This /// assumes that we're not at the end of the range we're iterating over. pub(crate) fn next_positions(&self) -> (InputPosition, InputPosition) {