pub enum NumberRepresentation {
Infinity,
NegativeInfinity,
NaN,
Hex(NumberSign, u64),
Bin(NumberSign, u64),
Octal(NumberSign, u64, bool),
Number {
elided_zero_before_point: bool,
trailing_point: bool,
internal: f64,
},
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
Variants§
Infinity
NegativeInfinity
NaN
Hex(NumberSign, u64)
Bin(NumberSign, u64)
Octal(NumberSign, u64, bool)
Number
Fields
BigInt(NumberSign, String)
Implementations§
source§impl NumberRepresentation
impl NumberRepresentation
pub fn negate(&self) -> Self
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<NumberRepresentation> for f64
impl From<NumberRepresentation> for f64
source§fn from(this: NumberRepresentation) -> f64
fn from(this: NumberRepresentation) -> f64
Converts to this type from the input type.
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 Visitable for NumberRepresentation
impl Visitable for NumberRepresentation
fn visit<TData>( &self, _visitors: &mut (impl VisitorReceiver<TData> + ?Sized), _data: &mut TData, _options: &VisitSettings, _chain: &mut Annex<'_, Chain> )
fn visit_mut<TData>( &mut self, _visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), _data: &mut TData, _options: &VisitSettings, _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