Enum syn_solidity::LitNumber
source · pub enum LitNumber {
Int(LitInt),
Float(LitFloat),
}
Expand description
An integer or fixed-point number literal: 1
or 1.0
.
Variants§
Implementations§
source§impl LitNumber
impl LitNumber
pub fn new_int(repr: &str, span: Span) -> Self
pub fn new_fixed(repr: &str, span: Span) -> Self
pub fn peek(lookahead: &Lookahead1<'_>) -> bool
sourcepub fn base10_digits(&self) -> &str
pub fn base10_digits(&self) -> &str
Returns the base-10 digits of the literal.
sourcepub fn base10_parse<N>(&self) -> Result<N>
pub fn base10_parse<N>(&self) -> Result<N>
Parses the literal into a selected number type.
This is equivalent to lit.base10_digits().parse()
except that the
resulting errors will be correctly spanned to point to the literal token
in the macro input.
pub fn suffix(&self) -> &str
pub fn token(&self) -> Literal
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LitNumber
impl !Send for LitNumber
impl !Sync for LitNumber
impl Unpin for LitNumber
impl UnwindSafe for LitNumber
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