swc_ecma_ast

Trait Pass

Source
pub trait Pass {
    // Required method
    fn process(&mut self, program: &mut Program);
}
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§

Source

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

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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,

Source§

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

Source§

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

Source§

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

Source§

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

Optional pass implementation.

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§