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 {}
|
|
|
|
|
2022-07-05 07:38:27 +03:00
|
|
|
#[derive(Debug, PartialEq)]
|
2020-05-25 16:53:48 +03:00
|
|
|
pub struct Item {
|
|
|
|
pub opt_vec1: Option<Vec<Item>>,
|
|
|
|
pub opt_vec2: Option<Vec<Enum>>,
|
|
|
|
}
|
2022-07-05 07:38:27 +03:00
|
|
|
#[derive(Debug, PartialEq)]
|
2020-05-25 16:53:48 +03:00
|
|
|
pub enum Enum {
|
|
|
|
Item(Item),
|
|
|
|
}
|
|
|
|
|
|
|
|
define!({
|
|
|
|
pub struct Item {
|
|
|
|
pub opt_vec1: Option<Vec<Item>>,
|
|
|
|
pub opt_vec2: Option<Vec<Enum>>,
|
|
|
|
}
|
|
|
|
pub enum Enum {
|
|
|
|
Item(Item),
|
|
|
|
}
|
|
|
|
});
|