add support for @,_,* tokens

This commit is contained in:
Luke Boswell 2023-03-12 17:01:05 +11:00
parent 5a0a7289ba
commit 1e26769313
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
2 changed files with 22 additions and 1 deletions

View file

@ -45,6 +45,7 @@ pub fn highlight(code: &str) -> Vec<String> {
| Token::ColonEquals
| Token::Colon
| Token::And
| Token::AtSign
| Token::QuestionMark => {
buf = push_html_span(buf, current_text, "kw");
}
@ -63,6 +64,7 @@ pub fn highlight(code: &str) -> Vec<String> {
| Token::LessThanEquals
| Token::DoubleEquals
| Token::DoubleBar
| Token::Multiply
| Token::Plus
| Token::DoubleAnd => {
buf = push_html_span(buf, current_text, "op");
@ -81,7 +83,8 @@ pub fn highlight(code: &str) -> Vec<String> {
buf = push_html_span(buf, current_text, "upperident");
}
// Variables modules and field names
Token::LowerIdent => {
Token::LowerIdent
| Token::Underscore => {
buf = push_html_span(buf, current_text, "lowerident");
}
// Anyting else that wasn't tokenised