pub enum Literal {
}Expand description
A CEL literal, one variant per concrete Rust type crate::ParserContext::push_literal can
receive from push_literal_token in lib.rs.
Byte literals (b'A') and u8-suffixed integer literals (65u8) both arrive as u8 and
are indistinguishable here — both become Literal::U8; a formatter that must reproduce exact
original syntax should re-slice the node’s original source text from its span instead of
relying on this enum to recover lexical form.
Variants§
I8(i8)
i8 literal (e.g. 1i8).
I16(i16)
i16 literal (e.g. 1i16).
I32(i32)
i32 literal, the default integer suffix (e.g. 1 or 1i32).
I64(i64)
i64 literal (e.g. 1i64).
I128(i128)
i128 literal (e.g. 1i128).
Isize(isize)
isize literal (e.g. 1isize).
U8(u8)
u8 literal or byte literal (e.g. 1u8 or b'A').
U16(u16)
u16 literal (e.g. 1u16).
U32(u32)
u32 literal (e.g. 1u32).
U64(u64)
u64 literal (e.g. 1u64).
U128(u128)
u128 literal (e.g. 1u128).
Usize(usize)
usize literal (e.g. 1usize).
F32(f32)
f32 literal (e.g. 1.0f32).
F64(f64)
f64 literal, the default float suffix (e.g. 1.0 or 1.0f64).
Bool(bool)
Boolean literal (true/false).
Char(char)
Character literal (e.g. 'a').
Str(String)
String literal (e.g. "x").
ByteStr(Vec<u8>)
Byte-string literal (e.g. b"x").
CStr(CString)
C-string literal (e.g. c"x").
Unit
Unit (()).