Add Decimal number type.

This commit is contained in:
Stephen Chung
2021-02-13 20:57:56 +08:00
parent 4fdd58f220
commit 3650b04c38
15 changed files with 477 additions and 16 deletions

View File

@@ -958,6 +958,12 @@ fn parse_primary(
input.next().unwrap();
Expr::FloatConstant(x, settings.pos)
}
#[cfg(feature = "decimal")]
Token::DecimalConstant(x) => {
let x = (*x).into();
input.next().unwrap();
Expr::DynamicConstant(Box::new(x), settings.pos)
}
// { - block statement as expression
Token::LeftBrace if settings.allow_stmt_expr => {