MCPcopy Create free account
hub / github.com/hashintel/hash / peek_n_span

Method peek_n_span

libs/@local/hashql/syntax-jexpr/src/parser/state.rs:69–79  ·  view source on GitHub ↗
(
        &mut self,
        context: &mut LexerContext,
        n: usize,
    )

Source from the content-addressed store, hash-verified

67 }
68
69 fn peek_n_span(
70 &mut self,
71 context: &mut LexerContext,
72 n: usize,
73 ) -> Result<Result<&Token<'source>, TextRange>, LexerDiagnostic> {
74 if self.peek_fill(context, n)? == LookaheadStatus::EndOfInput {
75 return Ok(Err(self.span()));
76 }
77
78 Ok(Ok(&self.buffer[n]))
79 }
80
81 fn advance(
82 &mut self,

Callers 1

peek_expectMethod · 0.80

Calls 4

OkInterface · 0.85
ErrInterface · 0.85
peek_fillMethod · 0.80
spanMethod · 0.45

Tested by

no test coverage detected