#[non_exhaustive]pub struct Literals {
pub separators: Separators,
pub legacy_octal: LegacyOctal,
pub hex_floats: bool,
}Expand description
How number literals are spelled and decoded: the literal decoding table.
Raw strings, heredocs, nowdocs, and interpolation pieces are token roles
(TokenRole::RawStr, TokenRole::Heredoc, TokenRole::StrPart); an
integer too large for 64 bits follows LangPolicy::overflow (see
LangPolicy).
#[non_exhaustive]: start from Literals::default and assign fields.
§Examples
use lower_lang::{LegacyOctal, Literals, Separators};
let mut php = Literals::default();
php.separators = Separators::BetweenDigits;
php.legacy_octal = LegacyOctal::Octal;
php.hex_floats = false;
assert!(Literals::default().hex_floats);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.separators: SeparatorsDigit separators.
legacy_octal: LegacyOctalA leading zero.
hex_floats: boolWhether hexadecimal floating-point literals (0x1.8p3 = 12.0, 0x1p-2
= 0.25) are accepted (C, Java, Rust’s hexf); they are decoded with
correct rounding to the nearest f64, subnormals included.
Trait Implementations§
impl Copy for Literals
impl Eq for Literals
impl StructuralPartialEq for Literals
Auto Trait Implementations§
impl Freeze for Literals
impl RefUnwindSafe for Literals
impl Send for Literals
impl Sync for Literals
impl Unpin for Literals
impl UnsafeUnpin for Literals
impl UnwindSafe for Literals
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more