ast-grep-py 0.38.7__tar.gz → 0.39.0__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.

Potentially problematic release.


This version of ast-grep-py might be problematic. Click here for more details.

Files changed (96) hide show
  1. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/Cargo.lock +146 -58
  2. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/Cargo.toml +7 -7
  3. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/PKG-INFO +1 -1
  4. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule/mod.rs +10 -3
  5. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule/relational_rule.rs +26 -0
  6. ast_grep_py-0.39.0/crates/config/src/rule/selector.rs +385 -0
  7. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/match_tree/match_node.rs +11 -2
  8. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/match_tree/strictness.rs +46 -1
  9. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/matcher/pattern.rs +17 -3
  10. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/Cargo.toml +6 -2
  11. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/lib.rs +18 -7
  12. ast_grep_py-0.39.0/crates/language/src/nix.rs +54 -0
  13. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/parsers.rs +6 -0
  14. ast_grep_py-0.39.0/crates/language/src/solidity.rs +53 -0
  15. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/src/py_lang.rs +1 -1
  16. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/src/py_node.rs +1 -1
  17. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/src/range.rs +2 -2
  18. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/pyproject.toml +1 -1
  19. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/README.md +0 -0
  20. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/ast_grep_py/__init__.py +0 -0
  21. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/ast_grep_py/ast_grep_py.pyi +0 -0
  22. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/ast_grep_py/py.typed +0 -0
  23. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/Cargo.toml +0 -0
  24. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/check_var.rs +0 -0
  25. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/combined.rs +0 -0
  26. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/fixer.rs +0 -0
  27. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/label.rs +0 -0
  28. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/lib.rs +0 -0
  29. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/maybe.rs +0 -0
  30. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule/deserialize_env.rs +0 -0
  31. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule/nth_child.rs +0 -0
  32. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule/range.rs +0 -0
  33. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule/referent_rule.rs +0 -0
  34. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule/stop_by.rs +0 -0
  35. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule_collection.rs +0 -0
  36. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule_config.rs +0 -0
  37. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/rule_core.rs +0 -0
  38. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/transform/mod.rs +0 -0
  39. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/transform/parse.rs +0 -0
  40. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/transform/rewrite.rs +0 -0
  41. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/transform/string_case.rs +0 -0
  42. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/config/src/transform/trans.rs +0 -0
  43. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/Cargo.toml +0 -0
  44. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/language.rs +0 -0
  45. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/lib.rs +0 -0
  46. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/match_tree/mod.rs +0 -0
  47. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/matcher/kind.rs +0 -0
  48. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/matcher/node_match.rs +0 -0
  49. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/matcher/text.rs +0 -0
  50. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/matcher.rs +0 -0
  51. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/meta_var.rs +0 -0
  52. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/node.rs +0 -0
  53. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/ops.rs +0 -0
  54. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/pinned.rs +0 -0
  55. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/replacer/indent.rs +0 -0
  56. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/replacer/structural.rs +0 -0
  57. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/replacer/template.rs +0 -0
  58. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/replacer.rs +0 -0
  59. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/source.rs +0 -0
  60. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/tree_sitter/mod.rs +0 -0
  61. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/core/src/tree_sitter/traversal.rs +0 -0
  62. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/dynamic/Cargo.toml +0 -0
  63. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/dynamic/src/custom_lang.rs +0 -0
  64. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/dynamic/src/lib.rs +0 -0
  65. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/bash.rs +0 -0
  66. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/cpp.rs +0 -0
  67. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/csharp.rs +0 -0
  68. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/css.rs +0 -0
  69. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/elixir.rs +0 -0
  70. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/go.rs +0 -0
  71. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/haskell.rs +0 -0
  72. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/html.rs +0 -0
  73. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/json.rs +0 -0
  74. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/kotlin.rs +0 -0
  75. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/lua.rs +0 -0
  76. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/php.rs +0 -0
  77. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/python.rs +0 -0
  78. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/ruby.rs +0 -0
  79. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/rust.rs +0 -0
  80. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/scala.rs +0 -0
  81. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/swift.rs +0 -0
  82. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/language/src/yaml.rs +0 -0
  83. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/Cargo.toml +0 -0
  84. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/README.md +0 -0
  85. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/ast_grep_py/__init__.py +0 -0
  86. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/ast_grep_py/ast_grep_py.pyi +0 -0
  87. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/ast_grep_py/py.typed +0 -0
  88. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/src/lib.rs +0 -0
  89. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/src/unicode_position.rs +0 -0
  90. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/tests/test_fix.py +0 -0
  91. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/tests/test_range.py +0 -0
  92. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/tests/test_register_lang.py +0 -0
  93. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/tests/test_rule.py +0 -0
  94. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/tests/test_simple.py +0 -0
  95. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/tests/test_traversal.py +0 -0
  96. {ast_grep_py-0.38.7 → ast_grep_py-0.39.0}/crates/pyo3/tests/test_wrong_usage.py +0 -0
@@ -109,7 +109,7 @@ dependencies = [
109
109
 
110
110
  [[package]]
111
111
  name = "ast-grep"
112
- version = "0.38.7"
112
+ version = "0.39.0"
113
113
  dependencies = [
114
114
  "ansi_term",
115
115
  "anyhow",
@@ -143,7 +143,7 @@ dependencies = [
143
143
 
144
144
  [[package]]
145
145
  name = "ast-grep-config"
146
- version = "0.38.7"
146
+ version = "0.39.0"
147
147
  dependencies = [
148
148
  "ast-grep-core",
149
149
  "bit-set",
@@ -158,7 +158,7 @@ dependencies = [
158
158
 
159
159
  [[package]]
160
160
  name = "ast-grep-core"
161
- version = "0.38.7"
161
+ version = "0.39.0"
162
162
  dependencies = [
163
163
  "bit-set",
164
164
  "regex",
@@ -169,7 +169,7 @@ dependencies = [
169
169
 
170
170
  [[package]]
171
171
  name = "ast-grep-dynamic"
172
- version = "0.38.7"
172
+ version = "0.39.0"
173
173
  dependencies = [
174
174
  "ast-grep-core",
175
175
  "ignore",
@@ -183,7 +183,7 @@ dependencies = [
183
183
 
184
184
  [[package]]
185
185
  name = "ast-grep-language"
186
- version = "0.38.7"
186
+ version = "0.39.0"
187
187
  dependencies = [
188
188
  "ast-grep-core",
189
189
  "ignore",
@@ -203,11 +203,13 @@ dependencies = [
203
203
  "tree-sitter-json",
204
204
  "tree-sitter-kotlin-sg",
205
205
  "tree-sitter-lua",
206
+ "tree-sitter-nix",
206
207
  "tree-sitter-php",
207
208
  "tree-sitter-python",
208
209
  "tree-sitter-ruby",
209
210
  "tree-sitter-rust",
210
211
  "tree-sitter-scala",
212
+ "tree-sitter-solidity",
211
213
  "tree-sitter-swift",
212
214
  "tree-sitter-typescript",
213
215
  "tree-sitter-yaml",
@@ -215,7 +217,7 @@ dependencies = [
215
217
 
216
218
  [[package]]
217
219
  name = "ast-grep-lsp"
218
- version = "0.38.7"
220
+ version = "0.39.0"
219
221
  dependencies = [
220
222
  "ast-grep-config",
221
223
  "ast-grep-core",
@@ -229,7 +231,7 @@ dependencies = [
229
231
 
230
232
  [[package]]
231
233
  name = "ast-grep-napi"
232
- version = "0.38.7"
234
+ version = "0.39.0"
233
235
  dependencies = [
234
236
  "ast-grep-config",
235
237
  "ast-grep-core",
@@ -237,7 +239,7 @@ dependencies = [
237
239
  "ast-grep-language",
238
240
  "ignore",
239
241
  "napi",
240
- "napi-build",
242
+ "napi-build 3.0.0-beta.0",
241
243
  "napi-derive",
242
244
  "serde_json",
243
245
  "tree-sitter",
@@ -245,7 +247,7 @@ dependencies = [
245
247
 
246
248
  [[package]]
247
249
  name = "ast-grep-py"
248
- version = "0.38.7"
250
+ version = "0.39.0"
249
251
  dependencies = [
250
252
  "anyhow",
251
253
  "ast-grep-config",
@@ -362,9 +364,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
362
364
 
363
365
  [[package]]
364
366
  name = "clap"
365
- version = "4.5.40"
367
+ version = "4.5.41"
366
368
  source = "registry+https://github.com/rust-lang/crates.io-index"
367
- checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f"
369
+ checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
368
370
  dependencies = [
369
371
  "clap_builder",
370
372
  "clap_derive",
@@ -372,9 +374,9 @@ dependencies = [
372
374
 
373
375
  [[package]]
374
376
  name = "clap_builder"
375
- version = "4.5.40"
377
+ version = "4.5.41"
376
378
  source = "registry+https://github.com/rust-lang/crates.io-index"
377
- checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e"
379
+ checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
378
380
  dependencies = [
379
381
  "anstream",
380
382
  "anstyle",
@@ -384,18 +386,18 @@ dependencies = [
384
386
 
385
387
  [[package]]
386
388
  name = "clap_complete"
387
- version = "4.5.54"
389
+ version = "4.5.55"
388
390
  source = "registry+https://github.com/rust-lang/crates.io-index"
389
- checksum = "aad5b1b4de04fead402672b48897030eec1f3bfe1550776322f59f6d6e6a5677"
391
+ checksum = "a5abde44486daf70c5be8b8f8f1b66c49f86236edf6fa2abadb4d961c4c6229a"
390
392
  dependencies = [
391
393
  "clap",
392
394
  ]
393
395
 
394
396
  [[package]]
395
397
  name = "clap_derive"
396
- version = "4.5.40"
398
+ version = "4.5.41"
397
399
  source = "registry+https://github.com/rust-lang/crates.io-index"
398
- checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce"
400
+ checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491"
399
401
  dependencies = [
400
402
  "heck",
401
403
  "proc-macro2",
@@ -428,18 +430,18 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
428
430
 
429
431
  [[package]]
430
432
  name = "convert_case"
431
- version = "0.6.0"
433
+ version = "0.7.1"
432
434
  source = "registry+https://github.com/rust-lang/crates.io-index"
433
- checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca"
435
+ checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7"
434
436
  dependencies = [
435
437
  "unicode-segmentation",
436
438
  ]
437
439
 
438
440
  [[package]]
439
441
  name = "convert_case"
440
- version = "0.7.1"
442
+ version = "0.8.0"
441
443
  source = "registry+https://github.com/rust-lang/crates.io-index"
442
- checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7"
444
+ checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f"
443
445
  dependencies = [
444
446
  "unicode-segmentation",
445
447
  ]
@@ -580,14 +582,20 @@ dependencies = [
580
582
 
581
583
  [[package]]
582
584
  name = "ctor"
583
- version = "0.2.9"
585
+ version = "0.4.2"
584
586
  source = "registry+https://github.com/rust-lang/crates.io-index"
585
- checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501"
587
+ checksum = "a4735f265ba6a1188052ca32d461028a7d1125868be18e287e756019da7607b5"
586
588
  dependencies = [
587
- "quote",
588
- "syn",
589
+ "ctor-proc-macro",
590
+ "dtor",
589
591
  ]
590
592
 
593
+ [[package]]
594
+ name = "ctor-proc-macro"
595
+ version = "0.0.5"
596
+ source = "registry+https://github.com/rust-lang/crates.io-index"
597
+ checksum = "4f211af61d8efdd104f96e57adf5e426ba1bc3ed7a4ead616e15e5881fd79c4d"
598
+
591
599
  [[package]]
592
600
  name = "dashmap"
593
601
  version = "6.1.0"
@@ -644,6 +652,21 @@ dependencies = [
644
652
  "litrs",
645
653
  ]
646
654
 
655
+ [[package]]
656
+ name = "dtor"
657
+ version = "0.0.6"
658
+ source = "registry+https://github.com/rust-lang/crates.io-index"
659
+ checksum = "97cbdf2ad6846025e8e25df05171abfb30e3ababa12ee0a0e44b9bbe570633a8"
660
+ dependencies = [
661
+ "dtor-proc-macro",
662
+ ]
663
+
664
+ [[package]]
665
+ name = "dtor-proc-macro"
666
+ version = "0.0.5"
667
+ source = "registry+https://github.com/rust-lang/crates.io-index"
668
+ checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055"
669
+
647
670
  [[package]]
648
671
  name = "dyn-clone"
649
672
  version = "1.0.19"
@@ -898,6 +921,17 @@ dependencies = [
898
921
  "unicode-width 0.1.14",
899
922
  ]
900
923
 
924
+ [[package]]
925
+ name = "io-uring"
926
+ version = "0.7.8"
927
+ source = "registry+https://github.com/rust-lang/crates.io-index"
928
+ checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
929
+ dependencies = [
930
+ "bitflags 2.9.0",
931
+ "cfg-if",
932
+ "libc",
933
+ ]
934
+
901
935
  [[package]]
902
936
  name = "is_terminal_polyfill"
903
937
  version = "1.70.1"
@@ -1049,34 +1083,41 @@ dependencies = [
1049
1083
 
1050
1084
  [[package]]
1051
1085
  name = "napi"
1052
- version = "2.16.17"
1086
+ version = "3.0.0"
1053
1087
  source = "registry+https://github.com/rust-lang/crates.io-index"
1054
- checksum = "55740c4ae1d8696773c78fdafd5d0e5fe9bc9f1b071c7ba493ba5c413a9184f3"
1088
+ checksum = "abf3f418eeb94d86f02f3388324017e1e21e36937e4b1d8075ea5843d980f766"
1055
1089
  dependencies = [
1056
1090
  "anyhow",
1057
1091
  "bitflags 2.9.0",
1058
1092
  "ctor",
1059
- "napi-derive",
1093
+ "napi-build 2.2.2",
1060
1094
  "napi-sys",
1061
- "once_cell",
1095
+ "nohash-hasher",
1096
+ "rustc-hash",
1062
1097
  "serde",
1063
1098
  "serde_json",
1064
1099
  ]
1065
1100
 
1066
1101
  [[package]]
1067
1102
  name = "napi-build"
1068
- version = "2.2.0"
1103
+ version = "2.2.2"
1104
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1105
+ checksum = "fff539e61c5e3dd4d7d283610662f5d672c2aea0f158df78af694f13dbb3287b"
1106
+
1107
+ [[package]]
1108
+ name = "napi-build"
1109
+ version = "3.0.0-beta.0"
1069
1110
  source = "registry+https://github.com/rust-lang/crates.io-index"
1070
- checksum = "03acbfa4f156a32188bfa09b86dc11a431b5725253fc1fc6f6df5bed273382c4"
1111
+ checksum = "42908a235da4c4a18c481eb5a8bb38570daa18581a68c508ca8efab662e38bc6"
1071
1112
 
1072
1113
  [[package]]
1073
1114
  name = "napi-derive"
1074
- version = "2.16.13"
1115
+ version = "3.0.0"
1075
1116
  source = "registry+https://github.com/rust-lang/crates.io-index"
1076
- checksum = "7cbe2585d8ac223f7d34f13701434b9d5f4eb9c332cccce8dee57ea18ab8ab0c"
1117
+ checksum = "ce09c2a155c7c38447a6ff1711899375bdd8f9dd5a50aad700a9c765c9f8a375"
1077
1118
  dependencies = [
1078
- "cfg-if",
1079
- "convert_case 0.6.0",
1119
+ "convert_case 0.8.0",
1120
+ "ctor",
1080
1121
  "napi-derive-backend",
1081
1122
  "proc-macro2",
1082
1123
  "quote",
@@ -1085,24 +1126,22 @@ dependencies = [
1085
1126
 
1086
1127
  [[package]]
1087
1128
  name = "napi-derive-backend"
1088
- version = "1.0.75"
1129
+ version = "2.0.0"
1089
1130
  source = "registry+https://github.com/rust-lang/crates.io-index"
1090
- checksum = "1639aaa9eeb76e91c6ae66da8ce3e89e921cd3885e99ec85f4abacae72fc91bf"
1131
+ checksum = "17923387d68ecfe057a04a38ee89aeb41f415c43b4c7a508a3683bf0c1511c5a"
1091
1132
  dependencies = [
1092
- "convert_case 0.6.0",
1093
- "once_cell",
1133
+ "convert_case 0.8.0",
1094
1134
  "proc-macro2",
1095
1135
  "quote",
1096
- "regex",
1097
1136
  "semver",
1098
1137
  "syn",
1099
1138
  ]
1100
1139
 
1101
1140
  [[package]]
1102
1141
  name = "napi-sys"
1103
- version = "2.4.0"
1142
+ version = "3.0.0"
1104
1143
  source = "registry+https://github.com/rust-lang/crates.io-index"
1105
- checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3"
1144
+ checksum = "3e4e7135a8f97aa0f1509cce21a8a1f9dcec1b50d8dee006b48a5adb69a9d64d"
1106
1145
  dependencies = [
1107
1146
  "libloading",
1108
1147
  ]
@@ -1128,6 +1167,12 @@ dependencies = [
1128
1167
  "libc",
1129
1168
  ]
1130
1169
 
1170
+ [[package]]
1171
+ name = "nohash-hasher"
1172
+ version = "0.2.0"
1173
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1174
+ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
1175
+
1131
1176
  [[package]]
1132
1177
  name = "normalize-line-endings"
1133
1178
  version = "0.3.0"
@@ -1370,6 +1415,12 @@ version = "0.1.24"
1370
1415
  source = "registry+https://github.com/rust-lang/crates.io-index"
1371
1416
  checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
1372
1417
 
1418
+ [[package]]
1419
+ name = "rustc-hash"
1420
+ version = "2.1.1"
1421
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1422
+ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
1423
+
1373
1424
  [[package]]
1374
1425
  name = "rustix"
1375
1426
  version = "1.0.5"
@@ -1467,9 +1518,9 @@ dependencies = [
1467
1518
 
1468
1519
  [[package]]
1469
1520
  name = "serde_json"
1470
- version = "1.0.140"
1521
+ version = "1.0.141"
1471
1522
  source = "registry+https://github.com/rust-lang/crates.io-index"
1472
- checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
1523
+ checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
1473
1524
  dependencies = [
1474
1525
  "indexmap",
1475
1526
  "itoa",
@@ -1715,13 +1766,17 @@ dependencies = [
1715
1766
 
1716
1767
  [[package]]
1717
1768
  name = "tokio"
1718
- version = "1.45.1"
1769
+ version = "1.46.1"
1719
1770
  source = "registry+https://github.com/rust-lang/crates.io-index"
1720
- checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779"
1771
+ checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
1721
1772
  dependencies = [
1722
1773
  "backtrace",
1723
1774
  "bytes",
1775
+ "io-uring",
1776
+ "libc",
1777
+ "mio 1.0.3",
1724
1778
  "pin-project-lite",
1779
+ "slab",
1725
1780
  ]
1726
1781
 
1727
1782
  [[package]]
@@ -1739,27 +1794,40 @@ dependencies = [
1739
1794
 
1740
1795
  [[package]]
1741
1796
  name = "toml_datetime"
1742
- version = "0.6.11"
1797
+ version = "0.7.0"
1743
1798
  source = "registry+https://github.com/rust-lang/crates.io-index"
1744
- checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
1799
+ checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3"
1800
+ dependencies = [
1801
+ "serde",
1802
+ ]
1745
1803
 
1746
1804
  [[package]]
1747
1805
  name = "toml_edit"
1748
- version = "0.22.27"
1806
+ version = "0.23.2"
1749
1807
  source = "registry+https://github.com/rust-lang/crates.io-index"
1750
- checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
1808
+ checksum = "d1dee9dc43ac2aaf7d3b774e2fba5148212bf2bd9374f4e50152ebe9afd03d42"
1751
1809
  dependencies = [
1752
1810
  "indexmap",
1753
1811
  "toml_datetime",
1754
- "toml_write",
1812
+ "toml_parser",
1813
+ "toml_writer",
1814
+ "winnow",
1815
+ ]
1816
+
1817
+ [[package]]
1818
+ name = "toml_parser"
1819
+ version = "1.0.1"
1820
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1821
+ checksum = "97200572db069e74c512a14117b296ba0a80a30123fbbb5aa1f4a348f639ca30"
1822
+ dependencies = [
1755
1823
  "winnow",
1756
1824
  ]
1757
1825
 
1758
1826
  [[package]]
1759
- name = "toml_write"
1760
- version = "0.1.2"
1827
+ name = "toml_writer"
1828
+ version = "1.0.2"
1761
1829
  source = "registry+https://github.com/rust-lang/crates.io-index"
1762
- checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
1830
+ checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64"
1763
1831
 
1764
1832
  [[package]]
1765
1833
  name = "tower"
@@ -1840,9 +1908,9 @@ dependencies = [
1840
1908
 
1841
1909
  [[package]]
1842
1910
  name = "tree-sitter"
1843
- version = "0.25.4"
1911
+ version = "0.25.8"
1844
1912
  source = "registry+https://github.com/rust-lang/crates.io-index"
1845
- checksum = "69aff09fea9a41fb061ae6b206cb87cac1b8db07df31be3ba271fbc26760f213"
1913
+ checksum = "6d7b8994f367f16e6fa14b5aebbcb350de5d7cbea82dc5b00ae997dd71680dd2"
1846
1914
  dependencies = [
1847
1915
  "cc",
1848
1916
  "regex",
@@ -1998,6 +2066,16 @@ dependencies = [
1998
2066
  "tree-sitter-language",
1999
2067
  ]
2000
2068
 
2069
+ [[package]]
2070
+ name = "tree-sitter-nix"
2071
+ version = "0.3.0"
2072
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2073
+ checksum = "4952a9733f3a98f6683a0ccd1035d84ab7a52f7e84eeed58548d86765ad92de3"
2074
+ dependencies = [
2075
+ "cc",
2076
+ "tree-sitter-language",
2077
+ ]
2078
+
2001
2079
  [[package]]
2002
2080
  name = "tree-sitter-php"
2003
2081
  version = "0.23.11"
@@ -2048,11 +2126,21 @@ dependencies = [
2048
2126
  "tree-sitter-language",
2049
2127
  ]
2050
2128
 
2129
+ [[package]]
2130
+ name = "tree-sitter-solidity"
2131
+ version = "1.2.11"
2132
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2133
+ checksum = "316bcbf903cd09a781734f4127ef21341e810cf85f89b0b96fffab48d55fd672"
2134
+ dependencies = [
2135
+ "cc",
2136
+ "tree-sitter-language",
2137
+ ]
2138
+
2051
2139
  [[package]]
2052
2140
  name = "tree-sitter-swift"
2053
- version = "0.7.0"
2141
+ version = "0.7.1"
2054
2142
  source = "registry+https://github.com/rust-lang/crates.io-index"
2055
- checksum = "bdc72ea9c62a6d188c9f7d64109a9b14b09231852b87229c68c44e8738b9e6b9"
2143
+ checksum = "4ef216011c3e3df4fa864736f347cb8d509b1066cf0c8549fb1fd81ac9832e59"
2056
2144
  dependencies = [
2057
2145
  "cc",
2058
2146
  "tree-sitter-language",
@@ -7,22 +7,22 @@ resolver = "2"
7
7
  lto = true
8
8
 
9
9
  [workspace.package]
10
- version = "0.38.7"
10
+ version = "0.39.0"
11
11
  authors = ["Herrington Darkholme <2883231+HerringtonDarkholme@users.noreply.github.com>"]
12
12
  edition = "2021"
13
13
  license = "MIT"
14
14
  documentation = "https://ast-grep.github.io/guide/introduction.html"
15
15
  homepage = "https://ast-grep.github.io/"
16
16
  repository = "https://github.com/ast-grep/ast-grep"
17
- rust-version = "1.70"
17
+ rust-version = "1.79"
18
18
  readme = "README.md"
19
19
 
20
20
  [workspace.dependencies]
21
- ast-grep-core = { path = "crates/core", version = "0.38.7", default-features = false }
22
- ast-grep-config = { path = "crates/config", version = "0.38.7" }
23
- ast-grep-dynamic = { path = "crates/dynamic", version = "0.38.7" }
24
- ast-grep-language = { path = "crates/language", version = "0.38.7" }
25
- ast-grep-lsp = { path = "crates/lsp", version = "0.38.7" }
21
+ ast-grep-core = { path = "crates/core", version = "0.39.0", default-features = false }
22
+ ast-grep-config = { path = "crates/config", version = "0.39.0" }
23
+ ast-grep-dynamic = { path = "crates/dynamic", version = "0.39.0" }
24
+ ast-grep-language = { path = "crates/language", version = "0.39.0" }
25
+ ast-grep-lsp = { path = "crates/lsp", version = "0.39.0" }
26
26
 
27
27
  bit-set = { version = "0.8.0" }
28
28
  ignore = { version = "0.4.22" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ast-grep-py
3
- Version: 0.38.7
3
+ Version: 0.39.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -3,10 +3,12 @@ mod nth_child;
3
3
  mod range;
4
4
  pub mod referent_rule;
5
5
  mod relational_rule;
6
+ mod selector;
6
7
  mod stop_by;
7
8
 
8
9
  pub use deserialize_env::DeserializeEnv;
9
10
  pub use relational_rule::Relation;
11
+ use selector::{parse_selector, SelectorError};
10
12
  pub use stop_by::StopBy;
11
13
 
12
14
  use crate::maybe::Maybe;
@@ -16,7 +18,7 @@ use referent_rule::{ReferentRule, ReferentRuleError};
16
18
  use relational_rule::{Follows, Has, Inside, Precedes};
17
19
 
18
20
  use ast_grep_core::language::Language;
19
- use ast_grep_core::matcher::{KindMatcher, KindMatcherError, RegexMatcher, RegexMatcherError};
21
+ use ast_grep_core::matcher::{KindMatcher, RegexMatcher, RegexMatcherError};
20
22
  use ast_grep_core::meta_var::MetaVarEnv;
21
23
  use ast_grep_core::{ops as o, Doc, Node};
22
24
  use ast_grep_core::{MatchStrictness, Matcher, Pattern, PatternError};
@@ -147,6 +149,8 @@ pub enum Strictness {
147
149
  Relaxed,
148
150
  /// ast-nodes excluding comments, without text
149
151
  Signature,
152
+ /// similar to smart, but node kinds are ignored, only text is matched.
153
+ Template,
150
154
  }
151
155
 
152
156
  impl From<MatchStrictness> for Strictness {
@@ -159,6 +163,7 @@ impl From<MatchStrictness> for Strictness {
159
163
  M::Ast => S::Ast,
160
164
  M::Relaxed => S::Relaxed,
161
165
  M::Signature => S::Signature,
166
+ M::Template => S::Template,
162
167
  }
163
168
  }
164
169
  }
@@ -173,6 +178,7 @@ impl From<Strictness> for MatchStrictness {
173
178
  S::Ast => M::Ast,
174
179
  S::Relaxed => M::Relaxed,
175
180
  S::Signature => M::Signature,
181
+ S::Template => M::Template,
176
182
  }
177
183
  }
178
184
  }
@@ -349,7 +355,7 @@ pub enum RuleSerializeError {
349
355
  #[error("Rule must have one positive matcher.")]
350
356
  MissPositiveMatcher,
351
357
  #[error("Rule contains invalid kind matcher.")]
352
- InvalidKind(#[from] KindMatcherError),
358
+ InvalidKind(#[from] SelectorError),
353
359
  #[error("Rule contains invalid pattern matcher.")]
354
360
  InvalidPattern(#[from] PatternError),
355
361
  #[error("Rule contains invalid nthChild.")]
@@ -470,7 +476,8 @@ fn deserialze_atomic_rule<L: Language>(
470
476
  });
471
477
  }
472
478
  if let Some(kind) = atomic.kind {
473
- rules.push(R::Kind(KindMatcher::try_new(&kind, env.lang.clone())?));
479
+ let rule = parse_selector(&kind, env.lang.clone())?;
480
+ rules.push(rule);
474
481
  }
475
482
  if let Some(regex) = atomic.regex {
476
483
  rules.push(R::Regex(RegexMatcher::try_new(&regex)?));
@@ -39,6 +39,20 @@ pub struct Inside {
39
39
  stop_by: StopBy,
40
40
  }
41
41
  impl Inside {
42
+ pub(crate) fn rule(rule: Rule) -> Self {
43
+ Self {
44
+ outer: rule,
45
+ field: None,
46
+ stop_by: StopBy::Neighbor,
47
+ }
48
+ }
49
+ pub(crate) fn rule_descent(rule: Rule) -> Self {
50
+ Self {
51
+ outer: rule,
52
+ field: None,
53
+ stop_by: StopBy::End,
54
+ }
55
+ }
42
56
  pub fn try_new<L: Language>(
43
57
  relation: Relation,
44
58
  env: &DeserializeEnv<L>,
@@ -225,6 +239,18 @@ pub struct Follows {
225
239
  stop_by: StopBy,
226
240
  }
227
241
  impl Follows {
242
+ pub(crate) fn rule(rule: Rule) -> Self {
243
+ Self {
244
+ former: rule,
245
+ stop_by: StopBy::Neighbor,
246
+ }
247
+ }
248
+ pub(crate) fn rule_descent(rule: Rule) -> Self {
249
+ Self {
250
+ former: rule,
251
+ stop_by: StopBy::End,
252
+ }
253
+ }
228
254
  pub fn try_new<L: Language>(
229
255
  relation: Relation,
230
256
  env: &DeserializeEnv<L>,