swc_core::ecma::visit::swc_ecma_ast

Trait Pass

pub trait Pass {
    // Required method
    fn process(&mut self, program: &mut Program);
}
Available on crate features __ecma and __visit only.
Expand description

A map from the Program to the Program.

This trait is used to implement transformations. The implementor may decide to implement [Fold] or [VisitMut] if the transform is fine to start from an arbitrary node.

Tuple of Pass implementations also implements Pass, but it’s limited to 12 items for fast compile time. If you have more passes, nest it like (a, (b, c), (d, e))

Required Methods§

fn process(&mut self, program: &mut Program)

Implementations on Foreign Types§

§

impl<A, B> Pass for (A, B)
where A: Pass, B: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C> Pass for (A, B, C)
where A: Pass, B: Pass, C: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D> Pass for (A, B, C, D)
where A: Pass, B: Pass, C: Pass, D: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E> Pass for (A, B, C, D, E)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F> Pass for (A, B, C, D, E, F)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F, G> Pass for (A, B, C, D, E, F, G)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass, G: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F, G, H> Pass for (A, B, C, D, E, F, G, H)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass, G: Pass, H: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F, G, H, I> Pass for (A, B, C, D, E, F, G, H, I)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass, G: Pass, H: Pass, I: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F, G, H, I, J> Pass for (A, B, C, D, E, F, G, H, I, J)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass, G: Pass, H: Pass, I: Pass, J: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F, G, H, I, J, K> Pass for (A, B, C, D, E, F, G, H, I, J, K)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass, G: Pass, H: Pass, I: Pass, J: Pass, K: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F, G, H, I, J, K, L> Pass for (A, B, C, D, E, F, G, H, I, J, K, L)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass, G: Pass, H: Pass, I: Pass, J: Pass, K: Pass, L: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> Pass for (A, B, C, D, E, F, G, H, I, J, K, L, M)
where A: Pass, B: Pass, C: Pass, D: Pass, E: Pass, F: Pass, G: Pass, H: Pass, I: Pass, J: Pass, K: Pass, L: Pass, M: Pass,

§

fn process(&mut self, program: &mut Program)

§

impl<P> Pass for Option<P>
where P: Pass,

Optional pass implementation.

§

fn process(&mut self, program: &mut Program)

§

impl<P> Pass for &mut P
where P: Pass + ?Sized,

§

fn process(&mut self, program: &mut Program)

§

impl<P> Pass for Box<P>
where P: Pass + ?Sized,

§

fn process(&mut self, program: &mut Program)

Implementors§

§

impl Pass for DropSpan

§

impl<L, R> Pass for Either<L, R>
where L: Pass, R: Pass,

§

impl<P> Pass for Optional<P>
where P: Pass,

§

impl<P> Pass for Repeat<P>
where P: Pass + Repeated,

§

impl<V> Pass for FoldPass<V>
where V: Fold,

§

impl<V> Pass for VisitMutPass<V>
where V: VisitMut,

§

impl<V> Pass for VisitPass<V>
where V: Visit,