oxc/crates/oxc_syntax/src/lib.rs
Ali Rezvani e6d11c6190
feat(syntax): module graph visitor. (#3062)
I've tried too hard to make it into a full-fledged depth first iterator, But had no success with it; It is the next best thing that I could've thought of.

Provides a way to visit the module graph from a ModuleRecord as its entry point.
2024-04-22 10:10:27 +08:00

43 lines
736 B
Rust

//! Common code for JavaScript Syntax
pub mod class;
pub mod identifier;
pub mod keyword;
pub mod module_graph_visitor;
pub mod module_record;
pub mod node;
pub mod operator;
pub mod precedence;
pub mod reference;
pub mod scope;
pub mod symbol;
pub mod xml_entities;
#[derive(Debug, Clone, Copy, PartialEq, Eq, 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, PartialEq, Eq, Hash)]
pub enum BigintBase {
Decimal,
Binary,
Octal,
Hex,
}
impl BigintBase {
pub fn is_base_10(&self) -> bool {
self == &Self::Decimal
}
}