2022-02-28 10:12:28 +03:00
|
|
|
#![allow(clippy::ptr_arg)]
|
|
|
|
|
2020-05-25 16:53:48 +03:00
|
|
|
use std::any::Any;
|
2022-02-09 09:33:32 +03:00
|
|
|
|
2020-07-23 20:18:22 +03:00
|
|
|
use swc_visit::define;
|
2020-05-25 16:53:48 +03:00
|
|
|
|
|
|
|
/// 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),
|
|
|
|
}
|
|
|
|
});
|