Support underscores in decimal places

This commit is contained in:
2024-11-25 20:08:09 -07:00
parent 2432156d8c
commit 4b55aac15f

View File

@@ -667,6 +667,13 @@ This is a skippable line"#,
fn test_parse_decimal_with_underscore() -> Result<()> { fn test_parse_decimal_with_underscore() -> Result<()> {
let mut tokenizer = Tokenizer::from(String::from("1_000.000_6")); let mut tokenizer = Tokenizer::from(String::from("1_000.000_6"));
let token = tokenizer.next_token()?.unwrap();
assert_eq!(
token.token_type,
TokenType::Number(Number::Decimal(Decimal::new(10000006, 4))) // 1000.0006
);
Ok(()) Ok(())
} }