hey it can calculate 4 again xP

This commit is contained in:
LunarAkai 2025-08-07 01:37:01 +02:00
commit 8a44d045ae
7 changed files with 50 additions and 36 deletions

View file

@ -37,9 +37,12 @@ pub enum Token<'src> {
#[token("}")]
BraceEnd,
#[regex("[0-9]+", |lex| lex.slice().parse::<i64>().unwrap())]
#[regex(r"[+-]?[0-9]+", |lex| lex.slice().parse::<i64>().unwrap(), priority = 3)]
Integer(i64),
#[regex(r"[+-]?([0-9]*[.])?[0-9]+", |lex| lex.slice().parse::<f64>().unwrap())]
Float(f64),
#[regex(r"[_a-zA-Z][_0-9a-zA-Z]*")]
Ident(&'src str),