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

Method prev

src/ore/src/lex.rs:61–68  ·  view source on GitHub ↗

Returns the previous character in the buffer, positioning the internal cursor to before the character. The next call to `LexBuf::next` will return the same character. # Panics Panics if `prev` is called when the internal cursor is positioned at the beginning of the buffer.

(&mut self)

Source from the content-addressed store, hash-verified

59 /// Panics if `prev` is called when the internal cursor is positioned at
60 /// the beginning of the buffer.
61 pub fn prev(&mut self) -> char {
62 if let Some(c) = self.buf[..self.pos].chars().rev().next() {
63 self.pos -= c.len_utf8();
64 c
65 } else {
66 panic!("LexBuf::prev called on buffer at position 0")
67 }
68 }
69
70 /// Advances the internal cursor past the next character in the buffer if
71 /// the character is `ch`.

Callers 8

parse_identFunction · 0.80
lex_identFunction · 0.80
lex_numberFunction · 0.80
lex_opFunction · 0.80
buildMethod · 0.80
parse_list_innerFunction · 0.80
lex_unquoted_elementFunction · 0.80
parse_map_innerFunction · 0.80

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected