macro_rules! const_value {
(true) => { ... };
(false) => { ... };
($l:literal) => { ... };
}
Expand description
This macro converts literal values into constant representations based on their type.
It accepts the literal tokens true and false to produce boolean constants, and for a general literal it attempts runtime type checking to determine whether it is a string, an integer, or a floating-point value, converting it accordingly. If the literal does not match any of these supported types, the macro causes a panic with an invalid literal message.