ast-grep-cli 0.22.2__tar.gz → 0.22.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/Cargo.lock +9 -9
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/Cargo.toml +6 -6
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/PKG-INFO +1 -1
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/node.rs +26 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/pyproject.toml +1 -1
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/LICENSE +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/README.md +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/Cargo.toml +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/bin/ast-grep.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/completions.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/config.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/error.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/lang/custom_lang.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/lang/lang_globs.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/lang.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/lib.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/lsp.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/main.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/new.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/print/cloud_print.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/print/colored_print/test.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/print/colored_print.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/print/interactive_print.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/print/json_print.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/print/mod.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/run.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/scan.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/utils.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/verify/case_result.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/verify/find_file.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/verify/mod.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/verify/reporter.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/verify/snapshot.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/src/verify/test_case.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/tests/common/mod.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/tests/run_test.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/tests/scan_test.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/cli/tests/verify_test.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/Cargo.toml +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/check_var.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/combined.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/fixer.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/lib.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/maybe.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule/deserialize_env.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule/mod.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule/referent_rule.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule/relational_rule.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule/stop_by.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule_collection.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule_config.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/rule_core.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/transform/mod.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/transform/rewrite.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/transform/string_case.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/config/src/transform/transformation.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/Cargo.toml +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/language.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/lib.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/match_tree.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/matcher/kind.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/matcher/node_match.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/matcher/pattern.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/matcher/text.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/matcher.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/meta_var.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/ops.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/pinned.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/replacer/indent.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/replacer/structural.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/replacer/template.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/replacer.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/source.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/core/src/traversal.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/dynamic/Cargo.toml +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/dynamic/src/lib.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/Cargo.toml +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/bash.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/cpp.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/csharp.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/css.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/elixir.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/go.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/haskell.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/html.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/json.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/kotlin.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/lib.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/lua.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/parsers.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/php.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/python.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/ruby.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/rust.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/scala.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/language/src/swift.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/lsp/Cargo.toml +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/lsp/src/lib.rs +0 -0
- {ast_grep_cli-0.22.2 → ast_grep_cli-0.22.3}/crates/lsp/tests/basic.rs +0 -0
|
@@ -113,7 +113,7 @@ dependencies = [
|
|
|
113
113
|
|
|
114
114
|
[[package]]
|
|
115
115
|
name = "ast-grep"
|
|
116
|
-
version = "0.22.
|
|
116
|
+
version = "0.22.3"
|
|
117
117
|
dependencies = [
|
|
118
118
|
"ansi_term",
|
|
119
119
|
"anyhow",
|
|
@@ -144,7 +144,7 @@ dependencies = [
|
|
|
144
144
|
|
|
145
145
|
[[package]]
|
|
146
146
|
name = "ast-grep-config"
|
|
147
|
-
version = "0.22.
|
|
147
|
+
version = "0.22.3"
|
|
148
148
|
dependencies = [
|
|
149
149
|
"anyhow",
|
|
150
150
|
"ast-grep-core",
|
|
@@ -160,7 +160,7 @@ dependencies = [
|
|
|
160
160
|
|
|
161
161
|
[[package]]
|
|
162
162
|
name = "ast-grep-core"
|
|
163
|
-
version = "0.22.
|
|
163
|
+
version = "0.22.3"
|
|
164
164
|
dependencies = [
|
|
165
165
|
"bit-set",
|
|
166
166
|
"regex",
|
|
@@ -171,7 +171,7 @@ dependencies = [
|
|
|
171
171
|
|
|
172
172
|
[[package]]
|
|
173
173
|
name = "ast-grep-dynamic"
|
|
174
|
-
version = "0.22.
|
|
174
|
+
version = "0.22.3"
|
|
175
175
|
dependencies = [
|
|
176
176
|
"ast-grep-core",
|
|
177
177
|
"ignore",
|
|
@@ -183,7 +183,7 @@ dependencies = [
|
|
|
183
183
|
|
|
184
184
|
[[package]]
|
|
185
185
|
name = "ast-grep-language"
|
|
186
|
-
version = "0.22.
|
|
186
|
+
version = "0.22.3"
|
|
187
187
|
dependencies = [
|
|
188
188
|
"ast-grep-core",
|
|
189
189
|
"ignore",
|
|
@@ -214,7 +214,7 @@ dependencies = [
|
|
|
214
214
|
|
|
215
215
|
[[package]]
|
|
216
216
|
name = "ast-grep-lsp"
|
|
217
|
-
version = "0.22.
|
|
217
|
+
version = "0.22.3"
|
|
218
218
|
dependencies = [
|
|
219
219
|
"ast-grep-config",
|
|
220
220
|
"ast-grep-core",
|
|
@@ -228,7 +228,7 @@ dependencies = [
|
|
|
228
228
|
|
|
229
229
|
[[package]]
|
|
230
230
|
name = "ast-grep-napi"
|
|
231
|
-
version = "0.22.
|
|
231
|
+
version = "0.22.3"
|
|
232
232
|
dependencies = [
|
|
233
233
|
"ast-grep-config",
|
|
234
234
|
"ast-grep-core",
|
|
@@ -246,7 +246,7 @@ dependencies = [
|
|
|
246
246
|
|
|
247
247
|
[[package]]
|
|
248
248
|
name = "ast-grep-py"
|
|
249
|
-
version = "0.22.
|
|
249
|
+
version = "0.22.3"
|
|
250
250
|
dependencies = [
|
|
251
251
|
"anyhow",
|
|
252
252
|
"ast-grep-config",
|
|
@@ -312,7 +312,7 @@ dependencies = [
|
|
|
312
312
|
|
|
313
313
|
[[package]]
|
|
314
314
|
name = "benches"
|
|
315
|
-
version = "0.22.
|
|
315
|
+
version = "0.22.3"
|
|
316
316
|
dependencies = [
|
|
317
317
|
"ast-grep-config",
|
|
318
318
|
"ast-grep-core",
|
|
@@ -7,7 +7,7 @@ resolver = "2"
|
|
|
7
7
|
lto = true
|
|
8
8
|
|
|
9
9
|
[workspace.package]
|
|
10
|
-
version = "0.22.
|
|
10
|
+
version = "0.22.3"
|
|
11
11
|
authors = ["Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>"]
|
|
12
12
|
edition = "2021"
|
|
13
13
|
license = "MIT"
|
|
@@ -18,11 +18,11 @@ rust-version = "1.67"
|
|
|
18
18
|
readme = "README.md"
|
|
19
19
|
|
|
20
20
|
[workspace.dependencies]
|
|
21
|
-
ast-grep-core = { path = "crates/core", version = "0.22.
|
|
22
|
-
ast-grep-config = { path = "crates/config", version = "0.22.
|
|
23
|
-
ast-grep-dynamic = { path = "crates/dynamic", version = "0.22.
|
|
24
|
-
ast-grep-language = { path = "crates/language", version = "0.22.
|
|
25
|
-
ast-grep-lsp = { path = "crates/lsp", version = "0.22.
|
|
21
|
+
ast-grep-core = { path = "crates/core", version = "0.22.3" }
|
|
22
|
+
ast-grep-config = { path = "crates/config", version = "0.22.3" }
|
|
23
|
+
ast-grep-dynamic = { path = "crates/dynamic", version = "0.22.3" }
|
|
24
|
+
ast-grep-language = { path = "crates/language", version = "0.22.3" }
|
|
25
|
+
ast-grep-lsp = { path = "crates/lsp", version = "0.22.3" }
|
|
26
26
|
|
|
27
27
|
bit-set = { version = "0.5.3" }
|
|
28
28
|
ignore = { version = "0.4.22" }
|
|
@@ -379,6 +379,7 @@ impl<'r, D: Doc> Node<'r, D> {
|
|
|
379
379
|
// NOTE: Need go to parent first, then move to current node by byte offset.
|
|
380
380
|
// This is because tree_sitter cursor is scoped to the starting node.
|
|
381
381
|
// See https://github.com/tree-sitter/tree-sitter/issues/567
|
|
382
|
+
#[cfg(not(target_arch = "wasm32"))]
|
|
382
383
|
pub fn next_all(&self) -> impl Iterator<Item = Node<'r, D>> + '_ {
|
|
383
384
|
// if root is none, use self as fallback to return a type-stable Iterator
|
|
384
385
|
let node = self.parent().unwrap_or_else(|| self.clone());
|
|
@@ -393,6 +394,18 @@ impl<'r, D: Doc> Node<'r, D> {
|
|
|
393
394
|
})
|
|
394
395
|
}
|
|
395
396
|
|
|
397
|
+
// wasm32 has wrong goto_first_child_for_byte
|
|
398
|
+
#[cfg(target_arch = "wasm32")]
|
|
399
|
+
pub fn next_all(&self) -> impl Iterator<Item = Node<'r, D>> + '_ {
|
|
400
|
+
let mut node = self.clone();
|
|
401
|
+
std::iter::from_fn(move || {
|
|
402
|
+
node.next().map(|n| {
|
|
403
|
+
node = n.clone();
|
|
404
|
+
n
|
|
405
|
+
})
|
|
406
|
+
})
|
|
407
|
+
}
|
|
408
|
+
|
|
396
409
|
#[must_use]
|
|
397
410
|
pub fn prev(&self) -> Option<Node<'r, D>> {
|
|
398
411
|
let inner = self.inner.prev_sibling()?;
|
|
@@ -402,6 +415,7 @@ impl<'r, D: Doc> Node<'r, D> {
|
|
|
402
415
|
})
|
|
403
416
|
}
|
|
404
417
|
|
|
418
|
+
#[cfg(not(target_arch = "wasm32"))]
|
|
405
419
|
pub fn prev_all(&self) -> impl Iterator<Item = Node<'r, D>> + '_ {
|
|
406
420
|
// if root is none, use self as fallback to return a type-stable Iterator
|
|
407
421
|
let node = self.parent().unwrap_or_else(|| self.clone());
|
|
@@ -416,6 +430,18 @@ impl<'r, D: Doc> Node<'r, D> {
|
|
|
416
430
|
})
|
|
417
431
|
}
|
|
418
432
|
|
|
433
|
+
// wasm32 has wrong goto_first_child_for_byte
|
|
434
|
+
#[cfg(target_arch = "wasm32")]
|
|
435
|
+
pub fn prev_all(&self) -> impl Iterator<Item = Node<'r, D>> + '_ {
|
|
436
|
+
let mut node = self.clone();
|
|
437
|
+
std::iter::from_fn(move || {
|
|
438
|
+
node.prev().map(|n| {
|
|
439
|
+
node = n.clone();
|
|
440
|
+
n
|
|
441
|
+
})
|
|
442
|
+
})
|
|
443
|
+
}
|
|
444
|
+
|
|
419
445
|
pub fn dfs<'s>(&'s self) -> Pre<'r, D> {
|
|
420
446
|
Pre::new(self)
|
|
421
447
|
}
|
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ast-grep-cli"
|
|
7
|
-
version = "0.22.
|
|
7
|
+
version = "0.22.3"
|
|
8
8
|
description = "Structural Search and Rewrite code at large scale using precise AST pattern."
|
|
9
9
|
authors = [{ name = "Herrington Darkholme", email = "2883231+HerringtonDarkholme@users.noreply.github.com" }]
|
|
10
10
|
maintainers = [{ name = "Herrington Darkholme", email = "2883231+HerringtonDarkholme@users.noreply.github.com" }]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|