diff --git a/src/protocol/input_source.rs b/src/protocol/input_source.rs index 0ea65391f07b7e6d4d08abf34978a09a61ff9ffd..93f133f9fd795e66c77b66bba97e7fad3b4f387e 100644 --- a/src/protocol/input_source.rs +++ b/src/protocol/input_source.rs @@ -454,6 +454,14 @@ impl ParseError { self.with_at_span(StatementKind::Info, source, span, msg) } + pub fn with_info_str_at_pos(self, source: &InputSource, pos: InputPosition, msg: &str) -> Self { + self.with_at_span( + StatementKind::Info, source, + InputSpan::from_positions(pos, pos.with_offset(1)), + msg.to_string() + ) + } + pub fn with_info_str_at_span(self, source: &InputSource, span: InputSpan, msg: &str) -> Self { self.with_at_span(StatementKind::Info, source, span, msg.to_string()) }