Skip to main content

highlight_code

Function highlight_code 

Source
pub fn highlight_code(
    source: &str,
    keywords: &[&'static str],
    commands: &[&'static str],
) -> Vec<(&'static str, String)>
Expand description

Tokenizes source into highlighted runs, classifying the given keywords and commands words while recognizing comments, strings, and numbers.