Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
1
third-party/vendor/swc_ecma_visit/.cargo-checksum.json
vendored
Normal file
1
third-party/vendor/swc_ecma_visit/.cargo-checksum.json
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"files":{"Cargo.toml":"f389cc53295c3286603f9ef4c27dbed3b7fe7366b41399da6314bfd5a22b1503","scripts/update.sh":"e710c2a3f8601896dc270d13b47749daebc4905e6812bcc1b1908bb6858db7e2","src/lib.rs":"e4c1ced0fe2c315f30c121a49164e1c38490f11a1e6717bf3ebdd37b3478ba5e","tests/main.rs":"9d2ff645637f9e74b8acf2e61f51210bd18f457701034c54e221cddba0a41beb"},"package":"0f628ec196e76e67892441e14eef2e423a738543d32bffdabfeec20c29582117"}
|
||||
58
third-party/vendor/swc_ecma_visit/Cargo.toml
vendored
Normal file
58
third-party/vendor/swc_ecma_visit/Cargo.toml
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
|
||||
#
|
||||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g., crates.io) dependencies.
|
||||
#
|
||||
# If you are reading this file be aware that the original Cargo.toml
|
||||
# will likely look very different (and much more reasonable).
|
||||
# See Cargo.toml.orig for the original contents.
|
||||
|
||||
[package]
|
||||
edition = "2021"
|
||||
name = "swc_ecma_visit"
|
||||
version = "0.95.0"
|
||||
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
|
||||
description = "Visitors for swc ecmascript nodes which works on stable rustc"
|
||||
documentation = "https://rustdoc.swc.rs/swc_ecma_visit/"
|
||||
license = "Apache-2.0"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = [
|
||||
"--cfg",
|
||||
"docsrs",
|
||||
]
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dependencies.num-bigint]
|
||||
version = "0.4"
|
||||
features = ["serde"]
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1"
|
||||
optional = true
|
||||
|
||||
[dependencies.swc_atoms]
|
||||
version = "0.5.9"
|
||||
|
||||
[dependencies.swc_common]
|
||||
version = "0.32.0"
|
||||
|
||||
[dependencies.swc_ecma_ast]
|
||||
version = "0.109.0"
|
||||
|
||||
[dependencies.swc_visit]
|
||||
version = "0.5.7"
|
||||
|
||||
[dependencies.tracing]
|
||||
version = "0.1.37"
|
||||
|
||||
[features]
|
||||
debug = []
|
||||
default = []
|
||||
path = []
|
||||
13
third-party/vendor/swc_ecma_visit/scripts/update.sh
vendored
Normal file
13
third-party/vendor/swc_ecma_visit/scripts/update.sh
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
for filename in ../swc_ecma_ast/src/*.rs; do
|
||||
# echo "$filename"
|
||||
while read -r line; do
|
||||
[[ "$line" =~ ^[[:space:]]*# ]] && continue
|
||||
[[ "$line" =~ ^[[:space:]]*\/ ]] && continue
|
||||
[[ "$line" =~ ^[[:space:]]*\/ ]] && continue
|
||||
echo "$line"
|
||||
done < "$filename"
|
||||
|
||||
done
|
||||
1931
third-party/vendor/swc_ecma_visit/src/lib.rs
vendored
Normal file
1931
third-party/vendor/swc_ecma_visit/src/lib.rs
vendored
Normal file
File diff suppressed because it is too large
Load diff
31
third-party/vendor/swc_ecma_visit/tests/main.rs
vendored
Normal file
31
third-party/vendor/swc_ecma_visit/tests/main.rs
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use swc_common::{chain, DUMMY_SP};
|
||||
use swc_ecma_ast::{Module, Program};
|
||||
use swc_ecma_visit::{Visit, VisitWith};
|
||||
|
||||
#[test]
|
||||
fn should_visit_program() {
|
||||
struct Pass1<'a>(&'a mut usize);
|
||||
struct Pass2;
|
||||
|
||||
impl<'a> Visit for Pass1<'a> {
|
||||
fn visit_program(&mut self, _program: &Program) {
|
||||
*self.0 += 1;
|
||||
}
|
||||
}
|
||||
|
||||
impl Visit for Pass2 {}
|
||||
|
||||
let n = Program::Module(Module {
|
||||
span: DUMMY_SP,
|
||||
body: vec![],
|
||||
shebang: None,
|
||||
});
|
||||
|
||||
let mut counter = 0;
|
||||
let p1 = Pass1(&mut counter);
|
||||
let p2 = Pass2;
|
||||
let mut pass = chain!(p1, p2);
|
||||
n.visit_with(&mut pass);
|
||||
|
||||
assert_eq!(counter, 1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue