hey it can calculate 4 again xP
This commit is contained in:
parent
d253497b3e
commit
8a44d045ae
7 changed files with 50 additions and 36 deletions
|
|
@ -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),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue