Create a new token source for the given lexer.
(lexer: Lexer<'src>, source: &str, start_offset: TextSize)
| 21 | impl<'src> TokenSource<'src> { |
| 22 | /// Create a new token source for the given lexer. |
| 23 | fn new(lexer: Lexer<'src>, source: &str, start_offset: TextSize) -> Self { |
| 24 | TokenSource { |
| 25 | lexer, |
| 26 | tokens: allocate_tokens_vec(&source[start_offset.to_usize()..]), |
| 27 | } |
| 28 | } |
| 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 { |
nothing calls this directly
no test coverage detected