swc/ecmascript/visit/macros/tests/fold.rs

30 lines
571 B
Rust
Raw Normal View History

2020-05-25 16:53:48 +03:00
use std::any::Any;
use swc_ecma_visit_macros::define;
/// 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),
}
});