swc/visit/tests/vec_opt.rs

26 lines
431 B
Rust
Raw Normal View History

2020-05-25 16:53:48 +03:00
use std::any::Any;
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 vec_opt1: Vec<Option<Item>>,
pub vec_opt2: Vec<Option<Enum>>,
}
pub enum Enum {
Item(Item),
}
define!({
pub struct Item {
pub vec_opt1: Vec<Option<Item>>,
pub vec_opt2: Vec<Option<Enum>>,
}
pub enum Enum {
Item(Item),
}
});