MCPcopy Index your code
hub / github.com/endbasic/endbasic / peek

Method peek

core/src/lexer.rs:761–767  ·  view source on GitHub ↗

Peeks the upcoming token. It is OK to call this function several times on the same token before extracting it from the lexer.

(&mut self)

Source from the content-addressed store, hash-verified

759 /// It is OK to call this function several times on the same token before extracting it from
760 /// the lexer.
761 pub fn peek(&mut self) -> Result<&TokenSpan> {
762 if self.peeked.is_none() {
763 let span = self.read()?;
764 self.peeked.replace(span);
765 }
766 Ok(self.peeked.as_ref().unwrap())
767 }
768
769 /// Reads the next token.
770 ///

Callers 15

expect_and_consumeMethod · 0.45
parse_untilMethod · 0.45
parse_assignmentMethod · 0.45
parse_builtin_callMethod · 0.45
parse_dataMethod · 0.45
parse_dim_asMethod · 0.45
parse_dimMethod · 0.45
parse_do_guardMethod · 0.45
reset_doMethod · 0.45

Calls 1

readMethod · 0.45

Tested by

no test coverage detected