MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / peek_prev_pos

Method peek_prev_pos

src/sql-parser/src/parser.rs:1813–1819  ·  view source on GitHub ↗

Return the byte position within the query string at which the previous token starts. Must be called after `next_token()`, otherwise might panic. OK to call after `next_token()` indicates an EOF.

(&self)

Source from the content-addressed store, hash-verified

1811 /// Must be called after `next_token()`, otherwise might panic.
1812 /// OK to call after `next_token()` indicates an EOF.
1813 fn peek_prev_pos(&self) -> usize {
1814 assert!(self.index > 0);
1815 match self.tokens.get(self.index - 1) {
1816 Some(token) => token.offset,
1817 None => self.sql.len(),
1818 }
1819 }
1820
1821 /// Report unexpected token
1822 fn expected<D, T>(

Callers 15

parse_statement_innerMethod · 0.80
parse_prefixMethod · 0.80
parse_functionMethod · 0.80
parse_extract_exprMethod · 0.80
parse_interval_valueMethod · 0.80
parse_infixMethod · 0.80
parse_operatorMethod · 0.80
parse_copyMethod · 0.80

Calls 2

getMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected