pub fn highlight(code: &str, language: &str) -> Vec<Token>Expand description
Highlight code as language and return a de-duplicated,
left-to-right sorted list of tokens with UTF-16 offsets.
§Errors
Returns an empty vector (not an error) when:
- the language is not supported — callers render plain text
- the code is empty — no tokens to produce
Grammar-compilation or parse failures are recoverable: we return an empty vector and the caller paints plain text. We never panic.