1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use std::borrow::Cow;
pub use swc_visit::*;
pub trait CompilerPass {
fn name() -> Cow<'static, str>;
}
impl<V> CompilerPass for Repeat<V>
where
V: CompilerPass + Repeated,
{
fn name() -> Cow<'static, str> {
Cow::Owned(format!("repeat({})", V::name()))
}
}
impl<A, B> CompilerPass for AndThen<A, B>
where
A: CompilerPass,
B: CompilerPass,
{
fn name() -> Cow<'static, str> {
Cow::Owned(format!("{} -> {}", A::name(), B::name()))
}
}