oxc/crates/oxc_syntax/src/lib.rs
2023-11-19 11:11:19 +08:00

42 lines
708 B
Rust

//! Common code for JavaScript Syntax
pub mod assumptions;
pub mod identifier;
pub mod module_record;
pub mod operator;
pub mod precedence;
pub mod reference;
pub mod scope;
pub mod symbol;
pub mod xml_entities;
pub use unicode_id_start;
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum NumberBase {
Float,
Decimal,
Binary,
Octal,
Hex,
}
impl NumberBase {
pub fn is_base_10(&self) -> bool {
matches!(self, Self::Float | Self::Decimal)
}
}
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum BigintBase {
Decimal,
Binary,
Octal,
Hex,
}
impl BigintBase {
pub fn is_base_10(&self) -> bool {
self == &Self::Decimal
}
}