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 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)

source§

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

source§

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

Implementors§