mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 11:11:30 +03:00
30 lines
571 B
Rust
30 lines
571 B
Rust
|
use std::any::Any;
|
||
|
use swc_ecma_visit_macros::define;
|
||
|
|
||
|
/// Visitable nodes.
|
||
|
pub trait Node: Any {}
|
||
|
|
||
|
impl<T: ?Sized> Node for T where T: Any {}
|
||
|
|
||
|
pub struct Item {
|
||
|
// pub field: usize,
|
||
|
// pub inner: Option<Box<Item>>,
|
||
|
pub opt_vec: Option<Vec<Item>>,
|
||
|
pub vec_opt: Vec<Option<Item>>,
|
||
|
}
|
||
|
pub enum Enum {
|
||
|
Item(Item),
|
||
|
}
|
||
|
|
||
|
define!({
|
||
|
pub struct Item {
|
||
|
// pub field: usize,
|
||
|
// pub inner: Option<Box<Item>>,
|
||
|
pub opt_vec: Option<Vec<Item>>,
|
||
|
pub vec_opt: Vec<Option<Item>>,
|
||
|
}
|
||
|
pub enum Enum {
|
||
|
Item(Item),
|
||
|
}
|
||
|
});
|