pub enum NumberRepresentation {
Infinity,
NegativeInfinity,
NaN,
Hex {
sign: NumberSign,
identifier_uppercase: bool,
value: u64,
},
Bin {
sign: NumberSign,
identifier_uppercase: bool,
value: u64,
},
Octal {
sign: NumberSign,
identifier_uppercase: Option<bool>,
value: u64,
},
Number {
value: f64,
before_point: u8,
after_point: Option<u8>,
},
Exponential {
sign: NumberSign,
value: f64,
exponent: i32,
identifier_uppercase: bool,
},
BigInt(NumberSign, String),
}
Expand description
TODO a mix between runtime numbers and source syntax based number TODO hex cases lost in input :( https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#sec-literals-numeric-literals
Some of these can’t be parsed, but are there to make is so that a number can be generated from just a f64
Variants§
Implementations§
source§impl NumberRepresentation
impl NumberRepresentation
pub fn as_js_string(self) -> String
Trait Implementations§
source§impl Clone for NumberRepresentation
impl Clone for NumberRepresentation
source§fn clone(&self) -> NumberRepresentation
fn clone(&self) -> NumberRepresentation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for NumberRepresentation
impl Debug for NumberRepresentation
source§impl Display for NumberRepresentation
impl Display for NumberRepresentation
source§impl From<f64> for NumberRepresentation
impl From<f64> for NumberRepresentation
source§impl FromStr for NumberRepresentation
impl FromStr for NumberRepresentation
source§impl Hash for NumberRepresentation
impl Hash for NumberRepresentation
source§impl PartialEq for NumberRepresentation
impl PartialEq for NumberRepresentation
source§impl SelfRustTokenize for NumberRepresentation
impl SelfRustTokenize for NumberRepresentation
fn append_to_token_stream(&self, token_stream: &mut TokenStream)
source§fn to_tokens(&self) -> TokenStream
fn to_tokens(&self) -> TokenStream
Returns the tokens used to construct self
source§impl Serialize for NumberRepresentation
impl Serialize for NumberRepresentation
source§impl TryFrom<NumberRepresentation> for f64
impl TryFrom<NumberRepresentation> for f64
source§impl Visitable for NumberRepresentation
impl Visitable for NumberRepresentation
fn visit<TData>( &self, _visitors: &mut (impl VisitorReceiver<TData> + ?Sized), _data: &mut TData, _options: &VisitOptions, _chain: &mut Annex<'_, Chain> )
fn visit_mut<TData>( &mut self, _visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), _data: &mut TData, _options: &VisitOptions, _chain: &mut Annex<'_, Chain> )
impl Eq for NumberRepresentation
Auto Trait Implementations§
impl RefUnwindSafe for NumberRepresentation
impl Send for NumberRepresentation
impl Sync for NumberRepresentation
impl Unpin for NumberRepresentation
impl UnwindSafe for NumberRepresentation
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