Tokenize a byte slice into owned [`MergeToken`]s. Uses the project's code-aware [`Tokenizer`] so that operators, strings, numbers, and comments are recognised as single tokens.
(content: &[u8])
| 81 | /// Uses the project's code-aware [`Tokenizer`] so that operators, |
| 82 | /// strings, numbers, and comments are recognised as single tokens. |
| 83 | pub fn tokenize(content: &[u8]) -> Vec<MergeToken> { |
| 84 | Tokenizer::tokenize_all(content) |
| 85 | .into_iter() |
| 86 | .map(|t| MergeToken::new(t.content())) |
| 87 | .collect() |
| 88 | } |
| 89 | |
| 90 | /// Perform a three-way merge of token sequences. |
| 91 | /// |