improve token categories and color scheme

This commit is contained in:
Luke Boswell 2023-03-10 11:38:42 +11:00
parent 7283a17367
commit 2bed7da218
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
3 changed files with 93 additions and 162 deletions

View file

@ -59,6 +59,7 @@ pub enum Token {
Arrow,
Pipe,
Backpass,
Decimal,
}
pub fn highlight(text: &str) -> Vec<Loc<Token>> {
@ -165,6 +166,10 @@ fn highlight_inner<'a>(
));
}
}
'.' => {
state.advance_mut(1);
tokens.push(Loc::at(Region::between(start, state.pos()), Token::Decimal));
}
'0'..='9' => {
if let Ok((_, _item, new_state)) =
positive_number_literal().parse(arena, state.clone(), 0)