FIX: no_float errors.

This commit is contained in:
Stephen Chung 2020-04-17 20:08:41 +08:00
parent c5f66e932b
commit 65d611b976
2 changed files with 3 additions and 0 deletions

View File

@ -871,6 +871,7 @@ fn parse_primary<'a>(
let mut root_expr = match token {
Token::IntegerConstant(x) => Expr::IntegerConstant(x, pos),
#[cfg(not(feature = "no_float"))]
Token::FloatConstant(x) => Expr::FloatConstant(x, pos),
Token::CharConstant(c) => Expr::CharConstant(c, pos),
Token::StringConst(s) => Expr::StringConstant(s.into(), pos),

View File

@ -120,6 +120,7 @@ impl fmt::Debug for Position {
#[derive(Debug, PartialEq, Clone)]
pub enum Token {
IntegerConstant(INT),
#[cfg(not(feature = "no_float"))]
FloatConstant(FLOAT),
Identifier(String),
CharConstant(char),
@ -197,6 +198,7 @@ impl Token {
match self {
IntegerConstant(i) => i.to_string().into(),
#[cfg(not(feature = "no_float"))]
FloatConstant(f) => f.to_string().into(),
Identifier(s) => s.into(),
CharConstant(c) => c.to_string().into(),