use std::fmt;
#[derive(Debug, Clone, PartialEq)]
pub enum Literal {
Int(i64),
BigInt(String),
Bool(bool),
String(String),
Bytes(Vec<u8>),
Null,
}
impl fmt::Display for Literal {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Literal::Int(n) => write!(f, "{}", n),
Literal::BigInt(s) => write!(f, "BigInteger(\"{}\")", s),
Literal::Bool(b) => write!(f, "{}", b),
Literal::String(s) => write!(f, "\"{}\"", s.escape_default()),
Literal::Bytes(b) => write!(f, "0x{}", hex::encode(b)),
Literal::Null => write!(f, "null"),
}
}
}