MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / from_source

Method from_source

crates/sith_python_parser/src/token_source.rs:31–38  ·  view source on GitHub ↗

Create a new token source from the given source code which starts at the given offset.

(source: &'src str, mode: Mode, start_offset: TextSize)

Source from the content-addressed store, hash-verified

29
30 /// Create a new token source from the given source code which starts at the given offset.
31 pub(crate) fn from_source(source: &'src str, mode: Mode, start_offset: TextSize) -> Self {
32 let lexer = Lexer::new(source, mode, start_offset);
33 let mut source = TokenSource::new(lexer);
34
35 // Initialize the token source so that the current token is set correctly.
36 source.do_bump();
37 source
38 }
39
40 /// Returns the kind of the current token.
41 pub(crate) fn current_kind(&self) -> TokenKind {

Callers

nothing calls this directly

Calls 1

do_bumpMethod · 0.45

Tested by

no test coverage detected