Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
40
third-party/vendor/swc_visit/tests/fold.rs
vendored
Normal file
40
third-party/vendor/swc_visit/tests/fold.rs
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#![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 field: usize,
|
||||
// pub inner: Option<Box<Item>>,
|
||||
pub opt_vec: Option<Vec<Item>>,
|
||||
pub vec_opt: Vec<Option<Item>>,
|
||||
|
||||
pub value: f64,
|
||||
}
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Enum {
|
||||
Item(Item),
|
||||
Boxed(Box<Enum>),
|
||||
}
|
||||
|
||||
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 value: f64,
|
||||
}
|
||||
pub enum Enum {
|
||||
Item(Item),
|
||||
Boxed(Box<Enum>),
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue