cl-ast: Add float support
- Smuggle floats as integers to maintain `eq` - This is bad, but not terrible for spec-compliant floats. Might have issues with NaN. cl_parser: Smuggle floats cl_interpret: unpack smuggled floats in float literal node
This commit is contained in:
@@ -50,6 +50,7 @@ mod display {
|
||||
Literal::Bool(v) => v.fmt(f),
|
||||
Literal::Char(v) => write!(f, "'{}'", v.escape_debug()),
|
||||
Literal::Int(v) => v.fmt(f),
|
||||
Literal::Float(v) => f64::from_bits(*v).fmt(f),
|
||||
Literal::String(v) => write!(f, "\"{}\"", v.escape_debug()),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user