swc/crates/swc_visit/tests/fold.rs

31 lines
560 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 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),
}
});