Skip to content

Commit

Permalink
Fix a typo (#234)
Browse files Browse the repository at this point in the history
The SI unit for 1000000 is M.
  • Loading branch information
lu-zero committed Jun 8, 2022
1 parent 18230cb commit 9913810
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ enum Token {
// Each pattern can have it's own callback.
#[regex("[0-9]+", |lex| lex.slice().parse())]
#[regex("[0-9]+k", kilo)]
#[regex("[0-9]+m", mega)]
#[regex("[0-9]+M", mega)]
Number(u64),
}

fn main() {
let mut lex = Token::lexer("5 42k 75m");
let mut lex = Token::lexer("5 42k 75M");

assert_eq!(lex.next(), Some(Token::Number(5)));
assert_eq!(lex.slice(), "5");
Expand All @@ -123,7 +123,7 @@ fn main() {
assert_eq!(lex.slice(), "42k");

assert_eq!(lex.next(), Some(Token::Number(75_000_000)));
assert_eq!(lex.slice(), "75m");
assert_eq!(lex.slice(), "75M");

assert_eq!(lex.next(), None);
}
Expand Down

0 comments on commit 9913810

Please sign in to comment.