mirror of
https://github.com/swc-project/swc.git
synced 2024-12-27 15:42:51 +03:00
31 lines
516 B
Rust
31 lines
516 B
Rust
#![allow(clippy::ptr_arg)]
|
|
|
|
use std::any::Any;
|
|
|
|
use swc_visit::define;
|
|
|
|
/// Visitable nodes.
|
|
pub trait Node: Any {}
|
|
|
|
impl<T: ?Sized> Node for T where T: Any {}
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
pub struct Item {
|
|
pub opt_vec1: Option<Vec<Item>>,
|
|
pub opt_vec2: Option<Vec<Enum>>,
|
|
}
|
|
#[derive(Debug, PartialEq)]
|
|
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),
|
|
}
|
|
});
|