Create a new token source for the given lexer.
(lexer: Lexer<'src>)
| 20 | impl<'src> TokenSource<'src> { |
| 21 | /// Create a new token source for the given lexer. |
| 22 | pub(crate) fn new(lexer: Lexer<'src>) -> Self { |
| 23 | // TODO(dhruvmanila): Use `allocate_tokens_vec` |
| 24 | TokenSource { |
| 25 | lexer, |
| 26 | tokens: vec![], |
| 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 outgoing calls
no test coverage detected