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:
@@ -245,7 +245,7 @@ impl Parse<'_> for Literal {
|
||||
TokenData::String(v) => Literal::String(v),
|
||||
TokenData::Character(v) => Literal::Char(v),
|
||||
TokenData::Integer(v) => Literal::Int(v),
|
||||
TokenData::Float(v) => todo!("Literal::Float({v})"),
|
||||
TokenData::Float(v) => Literal::Float(v.to_bits()),
|
||||
_ => panic!("Expected token data for {ty:?}"),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user