Skip to content

Commit

Permalink
Move period token test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan committed Feb 7, 2021
1 parent b24f55f commit f09f302
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,17 @@ impl<'a> Tokenizer<'a> {
}
s += &peeking_take_while(chars, |ch| matches!(ch, '0'..='9'));

if s == "." {
return Ok(Some(Token::Period));
}

let long = if chars.peek() == Some(&'L') {
chars.next();
true
} else {
false
};
if s == "." {
Ok(Some(Token::Period))
} else {
Ok(Some(Token::Number(s, long)))
}
Ok(Some(Token::Number(s, long)))
}
// punctuation
'(' => self.consume_and_return(chars, Token::LParen),
Expand Down

0 comments on commit f09f302

Please sign in to comment.