File tree Expand file tree Collapse file tree 19 files changed +429
-0
lines changed
crates/swc_ecma_transformer Expand file tree Collapse file tree 19 files changed +429
-0
lines changed Original file line number Diff line number Diff line change 1+ [package ]
2+ authors = [" 강동윤 <kdy1997.dev@gmail.com>" ]
3+ description = " Compatibility layer for the ECMAScript standard"
4+ documentation = " https://rustdoc.swc.rs/swc_ecma_transformer/"
5+ edition = { workspace = true }
6+ include = [" Cargo.toml" , " src/**/*.rs" ]
7+ license = { workspace = true }
8+ name = " swc_ecma_transformer"
9+ repository = { workspace = true }
10+ version = " 0.1.0"
11+
12+ [lints .rust ]
13+ unexpected_cfgs = { level = " warn" , check-cfg = [' cfg(swc_ast_unknown)' ] }
14+
15+ [dependencies ]
16+ tracing = { workspace = true }
17+ swc_ecma_ast = { version = " 18.0.0" , path = " ../swc_ecma_ast" }
18+ swc_ecma_hooks = { version = " 0.2.0" , path = " ../swc_ecma_hooks" }
19+ swc_ecma_transforms_base = { version = " 30.0.0" , path = " ../swc_ecma_transforms_base" }
20+ swc_ecma_utils = { version = " 24.0.0" , path = " ../swc_ecma_utils" }
21+ swc_ecma_visit = { version = " 18.0.1" , path = " ../swc_ecma_visit" }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct BugfixOptions { }
7+
8+ pub fn hook ( options : BugfixOptions ) -> impl VisitMutHook < TraverseCtx > {
9+ BugfixPass { options }
10+ }
11+
12+ struct BugfixPass {
13+ options : BugfixOptions ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for BugfixPass { }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct DecoratorOptions { }
7+
8+ pub fn hook ( options : DecoratorOptions ) -> impl VisitMutHook < TraverseCtx > {
9+ DecoratorPass { options }
10+ }
11+
12+ struct DecoratorPass {
13+ options : DecoratorOptions ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for DecoratorPass { }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct Es2015Options { }
7+
8+ pub fn hook ( options : Es2015Options ) -> impl VisitMutHook < TraverseCtx > {
9+ Es2015Pass { options }
10+ }
11+
12+ struct Es2015Pass {
13+ options : Es2015Options ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for Es2015Pass { }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct Es2016Options { }
7+
8+ pub fn hook ( options : Es2016Options ) -> impl VisitMutHook < TraverseCtx > {
9+ Es2016Pass { options }
10+ }
11+
12+ struct Es2016Pass {
13+ options : Es2016Options ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for Es2016Pass { }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct Es2017Options { }
7+
8+ pub fn hook ( options : Es2017Options ) -> impl VisitMutHook < TraverseCtx > {
9+ Es2017Pass { options }
10+ }
11+
12+ struct Es2017Pass {
13+ options : Es2017Options ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for Es2017Pass { }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct Es2018Options { }
7+
8+ pub fn hook ( options : Es2018Options ) -> impl VisitMutHook < TraverseCtx > {
9+ Es2018Pass { options }
10+ }
11+
12+ struct Es2018Pass {
13+ options : Es2018Options ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for Es2018Pass { }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct Es2019Options { }
7+
8+ pub fn hook ( options : Es2019Options ) -> impl VisitMutHook < TraverseCtx > {
9+ Es2019Pass { options }
10+ }
11+
12+ struct Es2019Pass {
13+ options : Es2019Options ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for Es2019Pass { }
Original file line number Diff line number Diff line change 1+ use swc_ecma_hooks:: VisitMutHook ;
2+
3+ use crate :: TraverseCtx ;
4+
5+ #[ derive( Debug , Default ) ]
6+ pub struct Es2020Options { }
7+
8+ pub fn hook ( options : Es2020Options ) -> impl VisitMutHook < TraverseCtx > {
9+ Es2020Pass { options }
10+ }
11+
12+ struct Es2020Pass {
13+ options : Es2020Options ,
14+ }
15+
16+ impl VisitMutHook < TraverseCtx > for Es2020Pass { }
You can’t perform that action at this time.
0 commit comments