FIX: no_float errors.
This commit is contained in:
parent
c5f66e932b
commit
65d611b976
@ -871,6 +871,7 @@ fn parse_primary<'a>(
|
|||||||
|
|
||||||
let mut root_expr = match token {
|
let mut root_expr = match token {
|
||||||
Token::IntegerConstant(x) => Expr::IntegerConstant(x, pos),
|
Token::IntegerConstant(x) => Expr::IntegerConstant(x, pos),
|
||||||
|
#[cfg(not(feature = "no_float"))]
|
||||||
Token::FloatConstant(x) => Expr::FloatConstant(x, pos),
|
Token::FloatConstant(x) => Expr::FloatConstant(x, pos),
|
||||||
Token::CharConstant(c) => Expr::CharConstant(c, pos),
|
Token::CharConstant(c) => Expr::CharConstant(c, pos),
|
||||||
Token::StringConst(s) => Expr::StringConstant(s.into(), pos),
|
Token::StringConst(s) => Expr::StringConstant(s.into(), pos),
|
||||||
|
@ -120,6 +120,7 @@ impl fmt::Debug for Position {
|
|||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub enum Token {
|
pub enum Token {
|
||||||
IntegerConstant(INT),
|
IntegerConstant(INT),
|
||||||
|
#[cfg(not(feature = "no_float"))]
|
||||||
FloatConstant(FLOAT),
|
FloatConstant(FLOAT),
|
||||||
Identifier(String),
|
Identifier(String),
|
||||||
CharConstant(char),
|
CharConstant(char),
|
||||||
@ -197,6 +198,7 @@ impl Token {
|
|||||||
|
|
||||||
match self {
|
match self {
|
||||||
IntegerConstant(i) => i.to_string().into(),
|
IntegerConstant(i) => i.to_string().into(),
|
||||||
|
#[cfg(not(feature = "no_float"))]
|
||||||
FloatConstant(f) => f.to_string().into(),
|
FloatConstant(f) => f.to_string().into(),
|
||||||
Identifier(s) => s.into(),
|
Identifier(s) => s.into(),
|
||||||
CharConstant(c) => c.to_string().into(),
|
CharConstant(c) => c.to_string().into(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user