polyglot-piranha 0.3.32__tar.gz → 0.3.33__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.
Files changed (77) hide show
  1. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/Cargo.lock +2 -2
  2. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/Cargo.toml +2 -2
  3. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/PKG-INFO +1 -1
  4. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/concrete_syntax_test.rs +17 -1
  5. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/LICENSE +0 -0
  6. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/NOTICE +0 -0
  7. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/README.md +0 -0
  8. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/plugins/pyproject.toml +0 -0
  9. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/pyproject.toml +0 -0
  10. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/go/edges.toml +0 -0
  11. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/go/rules.toml +0 -0
  12. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/go/scope_config.toml +0 -0
  13. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/java/edges.toml +0 -0
  14. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/java/rules.toml +0 -0
  15. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/java/scope_config.toml +0 -0
  16. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/java_cs/edges.toml +0 -0
  17. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/java_cs/rules.toml +0 -0
  18. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/java_cs/scope_config.toml +0 -0
  19. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/kt/edges.toml +0 -0
  20. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/kt/rules.toml +0 -0
  21. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/kt/scope_config.toml +0 -0
  22. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/ruby/edges.toml +0 -0
  23. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/ruby/rules.toml +0 -0
  24. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/ruby/scope_config.toml +0 -0
  25. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/scala/scope_config.toml +0 -0
  26. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/swift/edges.toml +0 -0
  27. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/swift/rules.toml +0 -0
  28. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/cleanup_rules/swift/scope_config.toml +0 -0
  29. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/df/README.md +0 -0
  30. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/df/analysis.rs +0 -0
  31. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/df/mod.rs +0 -0
  32. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/df/tag_analysis.rs +0 -0
  33. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/df/unit_tests/tag_analysis_test.rs +0 -0
  34. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/df/utils.rs +0 -0
  35. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/lib.rs +0 -0
  36. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/main.rs +0 -0
  37. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/capture_group_patterns.rs +0 -0
  38. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/concrete_syntax.rs +0 -0
  39. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/default_configs.rs +0 -0
  40. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/edit.rs +0 -0
  41. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/filter.rs +0 -0
  42. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/language.rs +0 -0
  43. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/matches.rs +0 -0
  44. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/mod.rs +0 -0
  45. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/outgoing_edges.rs +0 -0
  46. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/piranha_arguments.rs +0 -0
  47. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/piranha_output.rs +0 -0
  48. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/rule.rs +0 -0
  49. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/rule_graph.rs +0 -0
  50. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/rule_store.rs +0 -0
  51. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/scopes.rs +0 -0
  52. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/source_code_unit.rs +0 -0
  53. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/piranha_arguments_test.rs +0 -0
  54. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/rule_graph_validation_test.rs +0 -0
  55. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/rule_test.rs +0 -0
  56. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/scopes_test.rs +0 -0
  57. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/source_code_unit_test.rs +0 -0
  58. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/testdata/custom_builtin/edges.toml +0 -0
  59. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/models/unit_tests/testdata/custom_builtin/rules.toml +0 -0
  60. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/mod.rs +0 -0
  61. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_go.rs +0 -0
  62. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_java.rs +0 -0
  63. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_kt.rs +0 -0
  64. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_python.rs +0 -0
  65. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_scala.rs +0 -0
  66. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_scm.rs +0 -0
  67. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_strings.rs +0 -0
  68. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_swift.rs +0 -0
  69. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_thrift.rs +0 -0
  70. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_ts.rs +0 -0
  71. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_tsx.rs +0 -0
  72. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/tests/test_piranha_yaml.rs +0 -0
  73. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/utilities/mod.rs +0 -0
  74. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/utilities/regex_utilities.rs +0 -0
  75. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/utilities/tree_sitter_utilities.rs +0 -0
  76. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/utilities/unit_tests/tree_sitter_utilities_test.rs +0 -0
  77. {polyglot_piranha-0.3.32 → polyglot_piranha-0.3.33}/src/utilities/unit_tests/utilities_test.rs +0 -0
@@ -595,7 +595,7 @@ dependencies = [
595
595
 
596
596
  [[package]]
597
597
  name = "piranha"
598
- version = "0.3.32"
598
+ version = "0.3.33"
599
599
  dependencies = [
600
600
  "assert_cmd",
601
601
  "cc",
@@ -1087,7 +1087,7 @@ dependencies = [
1087
1087
  [[package]]
1088
1088
  name = "tree-sitter-kotlin"
1089
1089
  version = "0.3.5"
1090
- source = "git+https://github.com/danieltrt/tree-sitter-kotlin?rev=8eb82b294900b66965ecfe39cdcbb8b16c99ff71#8eb82b294900b66965ecfe39cdcbb8b16c99ff71"
1090
+ source = "git+https://github.com/danieltrt/tree-sitter-kotlin?rev=5e0b07cb2ba628842028313b60b97699cc5e0fee#5e0b07cb2ba628842028313b60b97699cc5e0fee"
1091
1091
  dependencies = [
1092
1092
  "cc",
1093
1093
  "tree-sitter",
@@ -2,7 +2,7 @@
2
2
  authors = ["Uber Technologies Inc."]
3
3
  name = "piranha"
4
4
  description = "Polyglot Piranha is a library for performing structural find and replace with deep cleanup."
5
- version = "0.3.32"
5
+ version = "0.3.33"
6
6
  edition = "2021"
7
7
  include = ["pyproject.toml", "src/"]
8
8
  exclude = ["legacy"]
@@ -49,7 +49,7 @@ ctrlc = "3.4"
49
49
  # TODO: Update if we upgrade tree-sitter to >=0.21
50
50
  # Kotlin's grammar needs to fix the way it parses unary expressions (currently -a + b gets parsed as - (a +b)).
51
51
  # Once we upstream the fix, we can point to the official version.
52
- tree-sitter-kotlin = { git = "https://github.com/danieltrt/tree-sitter-kotlin", rev = "8eb82b294900b66965ecfe39cdcbb8b16c99ff71" }
52
+ tree-sitter-kotlin = { git = "https://github.com/danieltrt/tree-sitter-kotlin", rev = "5e0b07cb2ba628842028313b60b97699cc5e0fee" }
53
53
  tree-sitter-java = "0.20.2"
54
54
  # TODO: Update after: https://github.com/alex-pinkus/tree-sitter-swift/issues/278 resolves
55
55
  tree-sitter-swift = { git = "https://github.com/satyam1749/tree-sitter-swift.git", rev = "08a28993599f1968bc81631a89690503e1db7704" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyglot_piranha
3
- Version: 0.3.32
3
+ Version: 0.3.33
4
4
  License-File: LICENSE
5
5
  License-File: NOTICE
6
6
  Summary: Polyglot Piranha is a library for performing structural find and replace with deep cleanup.
@@ -14,7 +14,10 @@
14
14
  use crate::models::capture_group_patterns::ConcreteSyntax;
15
15
  use crate::models::concrete_syntax::get_all_matches_for_concrete_syntax;
16
16
  use crate::models::default_configs::GO;
17
- use crate::models::{default_configs::JAVA, language::PiranhaLanguage};
17
+ use crate::models::{
18
+ default_configs::{JAVA, KOTLIN},
19
+ language::PiranhaLanguage,
20
+ };
18
21
 
19
22
  fn run_test(
20
23
  code: &str, pattern: &str, expected_matches: usize, expected_vars: Vec<Vec<(&str, &str)>>,
@@ -39,6 +42,19 @@ fn run_test(
39
42
  }
40
43
  }
41
44
 
45
+ #[test]
46
+ fn test_single_match_kotlin() {
47
+ run_test(
48
+ "class Something : BaseParameters(namespace = \"data\") {
49
+ val something_else: Boolean by parameter(\"something_else\")
50
+ }",
51
+ "val :[stale_property_name] : Boolean by parameter(\"something_else\")",
52
+ 1,
53
+ vec![vec![("stale_property_name", "something_else")]],
54
+ KOTLIN,
55
+ );
56
+ }
57
+
42
58
  #[test]
43
59
  fn test_single_match() {
44
60
  run_test(