mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
improve token categories and color scheme
This commit is contained in:
parent
7283a17367
commit
2bed7da218
3 changed files with 93 additions and 162 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue