polyglot-piranha 0.3.3__tar.gz → 0.3.4__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.
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/Cargo.lock +59 -52
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/Cargo.toml +4 -2
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/PKG-INFO +2 -2
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/go/rules.toml +7 -7
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/go/scope_config.toml +4 -4
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/java/rules.toml +26 -26
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/java/scope_config.toml +10 -10
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/kt/rules.toml +139 -67
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/kt/scope_config.toml +7 -7
- polyglot_piranha-0.3.4/src/cleanup_rules/swift/edges.toml +96 -0
- polyglot_piranha-0.3.4/src/cleanup_rules/swift/rules.toml +1127 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/swift/scope_config.toml +22 -6
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/lib.rs +8 -4
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/default_configs.rs +27 -4
- polyglot_piranha-0.3.4/src/models/filter.rs +279 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/language.rs +10 -10
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/matches.rs +1 -1
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/mod.rs +1 -1
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/piranha_arguments.rs +81 -80
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/rule.rs +16 -16
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/rule_store.rs +13 -5
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/scopes.rs +8 -8
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/unit_tests/piranha_arguments_test.rs +14 -12
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/unit_tests/rule_test.rs +8 -8
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/unit_tests/scopes_test.rs +4 -4
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/unit_tests/source_code_unit_test.rs +163 -11
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/mod.rs +12 -12
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/test_piranha_java.rs +87 -64
- polyglot_piranha-0.3.4/src/tests/test_piranha_swift.rs +101 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/utilities/mod.rs +7 -0
- polyglot_piranha-0.3.3/src/cleanup_rules/swift/edges.toml +0 -38
- polyglot_piranha-0.3.3/src/cleanup_rules/swift/rules.toml +0 -492
- polyglot_piranha-0.3.3/src/models/constraint.rs +0 -174
- polyglot_piranha-0.3.3/src/tests/test_piranha_swift.rs +0 -47
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/LICENSE +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/README.md +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/EnumWithClassSymbol.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/PiranhaRuntimeException.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/PiranhaUtils.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/UsageCounter.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/XPFlagCleaner.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/config/Config.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/config/MethodRecord.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/config/PiranhaConfigurationException.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/config/PiranhaEnumRecord.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/config/PiranhaMethodRecord.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/config/PiranhaRecord.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/testannotations/AnnotationArgument.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/testannotations/AnnotationResolutionException.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/testannotations/ResolvedTestAnnotation.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/testannotations/TestAnnotationResolver.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/main/java/com/uber/piranha/testannotations/TestAnnotationSpecRecord.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/java/com/uber/piranha/ConfigurationTest.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/java/com/uber/piranha/CorePiranhaTest.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/java/com/uber/piranha/EnumConstantTest.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/java/com/uber/piranha/PiranhaTestingHelpers.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/java/com/uber/piranha/TestCaseCleanUpTest.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/java/com/uber/piranha/TreatmentGroupsTest.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPFlagCleanerNegativeCases.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPFlagCleanerPositiveCases.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPFlagCleanerPositiveCasesControl.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPFlagCleanerPositiveCasesTreatment.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPMethodChainCases.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPMethodChainCasesControl.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPMethodChainCasesDoNotAllowMethodChain.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPMethodChainCasesDoNotallowArgMatchingAndMethodChain.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPMethodChainCasesTreatment.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPMethodChainCasesTreatmentDoNotAllowMatchingArgMethodInvc.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/XPTest.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/BoolParam.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/BoolParameter.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/OverlappingNameInterface.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/PVal.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/Parameter.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/SomeOtherInterface.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/SomeParamRev.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/com/uber/piranha/mock/StaticMthds.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/invalid/piranha.properties +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/invalid/properties_test_invalid.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/invalid/properties_test_invalid_2.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/invalid/properties_test_invalid_3.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/invalid/properties_test_invalid_4.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_enum_no_arg.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_method_chain_control.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_method_chain_treated.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_no_flag_method_name.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_no_flag_method_name_no_method_chain.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_no_method_chain.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_argument.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_clean_by_setters_ignore_others.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_noFlag.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_noTreatmentGroup.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_receive.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_receive_argument.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_return.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_return_argument.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_return_receive.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_return_receive_argument.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_with_enum_no_match.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_with_enum_wrong_arg.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_test_without_enum.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/piranha/src/test/resources/config/properties_unnecessary_instance_method.json +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/sample/src/main/java/com/uber/mylib/MyClass.java +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/sample/src/main/resources/com/uber/mylib/MyClass.bak +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/java/sample/src/main/resources/com/uber/mylib/MyClass.expect +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/javascript/src/config_checker.js +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/javascript/src/piranha.js +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/javascript/src/refactor.js +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/javascript/src/source_checker.js +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/objc/src/XPFlagRefactoring/CMakeLists.txt +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/objc/src/XPFlagRefactoring/README.txt +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/objc/src/XPFlagRefactoring/XPFlagRefactoring.cpp +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/legacy/objc/src/XPFlagRefactoring/XPFlagRefactoring.exports +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/pyproject.toml +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/go/edges.toml +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/java/edges.toml +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/cleanup_rules/kt/edges.toml +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/main.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/edit.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/outgoing_edges.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/piranha_output.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/rule_graph.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/models/source_code_unit.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/test_piranha_go.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/test_piranha_kt.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/test_piranha_python.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/test_piranha_thrift.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/test_piranha_ts.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/tests/test_piranha_tsx.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/utilities/tree_sitter_utilities.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/utilities/unit_tests/tree_sitter_utilities_test.rs +0 -0
- {polyglot_piranha-0.3.3 → polyglot_piranha-0.3.4}/src/utilities/unit_tests/utilities_test.rs +0 -0
@@ -13,9 +13,9 @@ dependencies = [
|
|
13
13
|
|
14
14
|
[[package]]
|
15
15
|
name = "anstream"
|
16
|
-
version = "0.3.
|
16
|
+
version = "0.3.2"
|
17
17
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
18
|
-
checksum = "
|
18
|
+
checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163"
|
19
19
|
dependencies = [
|
20
20
|
"anstyle",
|
21
21
|
"anstyle-parse",
|
@@ -106,9 +106,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|
106
106
|
|
107
107
|
[[package]]
|
108
108
|
name = "bstr"
|
109
|
-
version = "1.
|
109
|
+
version = "1.5.0"
|
110
110
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
111
|
-
checksum = "
|
111
|
+
checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5"
|
112
112
|
dependencies = [
|
113
113
|
"memchr",
|
114
114
|
"once_cell",
|
@@ -130,9 +130,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
130
130
|
|
131
131
|
[[package]]
|
132
132
|
name = "clap"
|
133
|
-
version = "4.
|
133
|
+
version = "4.3.0"
|
134
134
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
135
|
-
checksum = "
|
135
|
+
checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc"
|
136
136
|
dependencies = [
|
137
137
|
"clap_builder",
|
138
138
|
"clap_derive",
|
@@ -141,9 +141,9 @@ dependencies = [
|
|
141
141
|
|
142
142
|
[[package]]
|
143
143
|
name = "clap_builder"
|
144
|
-
version = "4.
|
144
|
+
version = "4.3.0"
|
145
145
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
146
|
-
checksum = "
|
146
|
+
checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990"
|
147
147
|
dependencies = [
|
148
148
|
"anstream",
|
149
149
|
"anstyle",
|
@@ -154,21 +154,21 @@ dependencies = [
|
|
154
154
|
|
155
155
|
[[package]]
|
156
156
|
name = "clap_derive"
|
157
|
-
version = "4.
|
157
|
+
version = "4.3.0"
|
158
158
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
159
|
-
checksum = "
|
159
|
+
checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b"
|
160
160
|
dependencies = [
|
161
161
|
"heck",
|
162
162
|
"proc-macro2",
|
163
163
|
"quote",
|
164
|
-
"syn 2.0.
|
164
|
+
"syn 2.0.17",
|
165
165
|
]
|
166
166
|
|
167
167
|
[[package]]
|
168
168
|
name = "clap_lex"
|
169
|
-
version = "0.
|
169
|
+
version = "0.5.0"
|
170
170
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
171
|
-
checksum = "
|
171
|
+
checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
|
172
172
|
|
173
173
|
[[package]]
|
174
174
|
name = "colorchoice"
|
@@ -405,6 +405,12 @@ dependencies = [
|
|
405
405
|
"syn 1.0.109",
|
406
406
|
]
|
407
407
|
|
408
|
+
[[package]]
|
409
|
+
name = "glob"
|
410
|
+
version = "0.3.1"
|
411
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
412
|
+
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
413
|
+
|
408
414
|
[[package]]
|
409
415
|
name = "hashbrown"
|
410
416
|
version = "0.12.3"
|
@@ -471,9 +477,9 @@ checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306"
|
|
471
477
|
|
472
478
|
[[package]]
|
473
479
|
name = "io-lifetimes"
|
474
|
-
version = "1.0.
|
480
|
+
version = "1.0.11"
|
475
481
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
476
|
-
checksum = "
|
482
|
+
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
|
477
483
|
dependencies = [
|
478
484
|
"hermit-abi 0.3.1",
|
479
485
|
"libc",
|
@@ -531,15 +537,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|
531
537
|
|
532
538
|
[[package]]
|
533
539
|
name = "libc"
|
534
|
-
version = "0.2.
|
540
|
+
version = "0.2.144"
|
535
541
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
536
|
-
checksum = "
|
542
|
+
checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
|
537
543
|
|
538
544
|
[[package]]
|
539
545
|
name = "linux-raw-sys"
|
540
|
-
version = "0.3.
|
546
|
+
version = "0.3.8"
|
541
547
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
542
|
-
checksum = "
|
548
|
+
checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
|
543
549
|
|
544
550
|
[[package]]
|
545
551
|
name = "lock_api"
|
@@ -631,7 +637,7 @@ dependencies = [
|
|
631
637
|
|
632
638
|
[[package]]
|
633
639
|
name = "piranha"
|
634
|
-
version = "0.3.
|
640
|
+
version = "0.3.4"
|
635
641
|
dependencies = [
|
636
642
|
"assert_cmd",
|
637
643
|
"cc",
|
@@ -640,6 +646,7 @@ dependencies = [
|
|
640
646
|
"derive_builder",
|
641
647
|
"env_logger",
|
642
648
|
"getset",
|
649
|
+
"glob",
|
643
650
|
"itertools",
|
644
651
|
"json",
|
645
652
|
"jwalk",
|
@@ -721,9 +728,9 @@ dependencies = [
|
|
721
728
|
|
722
729
|
[[package]]
|
723
730
|
name = "proc-macro2"
|
724
|
-
version = "1.0.
|
731
|
+
version = "1.0.59"
|
725
732
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
726
|
-
checksum = "
|
733
|
+
checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b"
|
727
734
|
dependencies = [
|
728
735
|
"unicode-ident",
|
729
736
|
]
|
@@ -801,9 +808,9 @@ dependencies = [
|
|
801
808
|
|
802
809
|
[[package]]
|
803
810
|
name = "quote"
|
804
|
-
version = "1.0.
|
811
|
+
version = "1.0.28"
|
805
812
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
806
|
-
checksum = "
|
813
|
+
checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
|
807
814
|
dependencies = [
|
808
815
|
"proc-macro2",
|
809
816
|
]
|
@@ -878,9 +885,9 @@ dependencies = [
|
|
878
885
|
|
879
886
|
[[package]]
|
880
887
|
name = "regex"
|
881
|
-
version = "1.8.
|
888
|
+
version = "1.8.3"
|
882
889
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
883
|
-
checksum = "
|
890
|
+
checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390"
|
884
891
|
dependencies = [
|
885
892
|
"aho-corasick",
|
886
893
|
"memchr",
|
@@ -895,9 +902,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
|
|
895
902
|
|
896
903
|
[[package]]
|
897
904
|
name = "regex-syntax"
|
898
|
-
version = "0.7.
|
905
|
+
version = "0.7.2"
|
899
906
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
900
|
-
checksum = "
|
907
|
+
checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
|
901
908
|
|
902
909
|
[[package]]
|
903
910
|
name = "remove_dir_all"
|
@@ -910,9 +917,9 @@ dependencies = [
|
|
910
917
|
|
911
918
|
[[package]]
|
912
919
|
name = "rustix"
|
913
|
-
version = "0.37.
|
920
|
+
version = "0.37.19"
|
914
921
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
915
|
-
checksum = "
|
922
|
+
checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d"
|
916
923
|
dependencies = [
|
917
924
|
"bitflags",
|
918
925
|
"errno",
|
@@ -936,19 +943,19 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|
936
943
|
|
937
944
|
[[package]]
|
938
945
|
name = "serde"
|
939
|
-
version = "1.0.
|
946
|
+
version = "1.0.163"
|
940
947
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
941
|
-
checksum = "
|
948
|
+
checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2"
|
942
949
|
|
943
950
|
[[package]]
|
944
951
|
name = "serde_derive"
|
945
|
-
version = "1.0.
|
952
|
+
version = "1.0.163"
|
946
953
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
947
|
-
checksum = "
|
954
|
+
checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e"
|
948
955
|
dependencies = [
|
949
956
|
"proc-macro2",
|
950
957
|
"quote",
|
951
|
-
"syn 2.0.
|
958
|
+
"syn 2.0.17",
|
952
959
|
]
|
953
960
|
|
954
961
|
[[package]]
|
@@ -964,9 +971,9 @@ dependencies = [
|
|
964
971
|
|
965
972
|
[[package]]
|
966
973
|
name = "serde_spanned"
|
967
|
-
version = "0.6.
|
974
|
+
version = "0.6.2"
|
968
975
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
969
|
-
checksum = "
|
976
|
+
checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d"
|
970
977
|
dependencies = [
|
971
978
|
"serde",
|
972
979
|
]
|
@@ -996,9 +1003,9 @@ dependencies = [
|
|
996
1003
|
|
997
1004
|
[[package]]
|
998
1005
|
name = "syn"
|
999
|
-
version = "2.0.
|
1006
|
+
version = "2.0.17"
|
1000
1007
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1001
|
-
checksum = "
|
1008
|
+
checksum = "45b6ddbb36c5b969c182aec3c4a0bce7df3fbad4b77114706a49aacc80567388"
|
1002
1009
|
dependencies = [
|
1003
1010
|
"proc-macro2",
|
1004
1011
|
"quote",
|
@@ -1007,9 +1014,9 @@ dependencies = [
|
|
1007
1014
|
|
1008
1015
|
[[package]]
|
1009
1016
|
name = "target-lexicon"
|
1010
|
-
version = "0.12.
|
1017
|
+
version = "0.12.7"
|
1011
1018
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1012
|
-
checksum = "
|
1019
|
+
checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5"
|
1013
1020
|
|
1014
1021
|
[[package]]
|
1015
1022
|
name = "tempdir"
|
@@ -1038,9 +1045,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
|
|
1038
1045
|
|
1039
1046
|
[[package]]
|
1040
1047
|
name = "toml"
|
1041
|
-
version = "0.7.
|
1048
|
+
version = "0.7.4"
|
1042
1049
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1043
|
-
checksum = "
|
1050
|
+
checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec"
|
1044
1051
|
dependencies = [
|
1045
1052
|
"serde",
|
1046
1053
|
"serde_spanned",
|
@@ -1050,18 +1057,18 @@ dependencies = [
|
|
1050
1057
|
|
1051
1058
|
[[package]]
|
1052
1059
|
name = "toml_datetime"
|
1053
|
-
version = "0.6.
|
1060
|
+
version = "0.6.2"
|
1054
1061
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1055
|
-
checksum = "
|
1062
|
+
checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f"
|
1056
1063
|
dependencies = [
|
1057
1064
|
"serde",
|
1058
1065
|
]
|
1059
1066
|
|
1060
1067
|
[[package]]
|
1061
1068
|
name = "toml_edit"
|
1062
|
-
version = "0.19.
|
1069
|
+
version = "0.19.10"
|
1063
1070
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1064
|
-
checksum = "
|
1071
|
+
checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739"
|
1065
1072
|
dependencies = [
|
1066
1073
|
"indexmap",
|
1067
1074
|
"serde",
|
@@ -1120,7 +1127,7 @@ dependencies = [
|
|
1120
1127
|
[[package]]
|
1121
1128
|
name = "tree-sitter-swift"
|
1122
1129
|
version = "0.3.6"
|
1123
|
-
source = "git+https://github.com/satyam1749/tree-sitter-swift.git?rev=
|
1130
|
+
source = "git+https://github.com/satyam1749/tree-sitter-swift.git?rev=895cd7814488cb32cf73f68a75458b4bc6d50a85#895cd7814488cb32cf73f68a75458b4bc6d50a85"
|
1124
1131
|
dependencies = [
|
1125
1132
|
"cc",
|
1126
1133
|
"tree-sitter",
|
@@ -1157,9 +1164,9 @@ dependencies = [
|
|
1157
1164
|
|
1158
1165
|
[[package]]
|
1159
1166
|
name = "unicode-ident"
|
1160
|
-
version = "1.0.
|
1167
|
+
version = "1.0.9"
|
1161
1168
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1162
|
-
checksum = "
|
1169
|
+
checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
|
1163
1170
|
|
1164
1171
|
[[package]]
|
1165
1172
|
name = "unindent"
|
@@ -1353,9 +1360,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
|
|
1353
1360
|
|
1354
1361
|
[[package]]
|
1355
1362
|
name = "winnow"
|
1356
|
-
version = "0.4.
|
1363
|
+
version = "0.4.6"
|
1357
1364
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
1358
|
-
checksum = "
|
1365
|
+
checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699"
|
1359
1366
|
dependencies = [
|
1360
1367
|
"memchr",
|
1361
1368
|
]
|
@@ -7,7 +7,7 @@ authors = [
|
|
7
7
|
]
|
8
8
|
name = "piranha"
|
9
9
|
description = "Polyglot Piranha is a library for performing structural find and replace with deep cleanup."
|
10
|
-
version = "0.3.
|
10
|
+
version = "0.3.4"
|
11
11
|
edition = "2021"
|
12
12
|
include = ["pyproject.toml", "src/"]
|
13
13
|
exclude = ["legacy"]
|
@@ -28,6 +28,7 @@ path = "src/main.rs"
|
|
28
28
|
name = "polyglot_piranha"
|
29
29
|
path = "src/lib.rs"
|
30
30
|
crate-type = ["cdylib", "rlib"]
|
31
|
+
doctest = false
|
31
32
|
|
32
33
|
[build-dependencies]
|
33
34
|
cc = "1.0.73"
|
@@ -53,7 +54,7 @@ tree-sitter-kotlin = { git = "https://github.com/ketkarameya/tree-sitter-kotlin.
|
|
53
54
|
# TODO: Update after next version is released (https://github.com/tree-sitter/tree-sitter-java/issues/146)
|
54
55
|
tree-sitter-java = { git = "https://github.com/tree-sitter/tree-sitter-java.git", rev = "c194ee5e6ede5f26cf4799feead4a8f165dcf14d" }
|
55
56
|
# TODO: Update after: https://github.com/alex-pinkus/tree-sitter-swift/issues/278 resolves
|
56
|
-
tree-sitter-swift = { git = "https://github.com/satyam1749/tree-sitter-swift.git", rev = "
|
57
|
+
tree-sitter-swift = { git = "https://github.com/satyam1749/tree-sitter-swift.git", rev = "895cd7814488cb32cf73f68a75458b4bc6d50a85" }
|
57
58
|
tree-sitter-python = "0.20.2"
|
58
59
|
tree-sitter-typescript = "0.20.1"
|
59
60
|
# TODO: Update after https://github.com/tree-sitter/tree-sitter-go/pull/103 lands
|
@@ -63,6 +64,7 @@ derive_builder = "0.12.0"
|
|
63
64
|
getset = "0.1.2"
|
64
65
|
pyo3 = "0.18.2"
|
65
66
|
pyo3-log = "0.8.1"
|
67
|
+
glob = "0.3.1"
|
66
68
|
|
67
69
|
[features]
|
68
70
|
extension-module = ["pyo3/extension-module"]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: polyglot_piranha
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.4
|
4
4
|
License-File: LICENSE
|
5
5
|
License-File: LICENSE
|
6
6
|
License-File: NOTICE
|
@@ -10,9 +10,9 @@ Author: Uber Technologies Inc.
|
|
10
10
|
Author-email: Ameya Ketkar <ketkara@uber.com>, Lazaro Clapp <lazaro@uber.com>
|
11
11
|
Requires-Python: >=3.7
|
12
12
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
13
|
-
Project-URL: repository, https://github.com/uber/piranha
|
14
13
|
Project-URL: homepage, https://github.com/uber/piranha
|
15
14
|
Project-URL: documentation, https://github.com/uber/piranha
|
15
|
+
Project-URL: repository, https://github.com/uber/piranha
|
16
16
|
|
17
17
|
# Piranha
|
18
18
|
|
@@ -452,10 +452,10 @@ replace_node = "short_v_decl"
|
|
452
452
|
is_seed_rule = false
|
453
453
|
# Check if there is an assignment to @variable_name with a value other than @value
|
454
454
|
# Note that the query is against a short_var_declaration while
|
455
|
-
# the
|
456
|
-
[[rules.
|
457
|
-
|
458
|
-
|
455
|
+
# the filter is against an assigment_statement
|
456
|
+
[[rules.filters]]
|
457
|
+
enclosing_node = "(block) @block"
|
458
|
+
not_contains = ["""
|
459
459
|
(
|
460
460
|
(assignment_statement
|
461
461
|
left: (expression_list
|
@@ -482,9 +482,9 @@ replace = "@value"
|
|
482
482
|
replace_node = "identifier"
|
483
483
|
holes = ["variable_name", "value"]
|
484
484
|
is_seed_rule = false
|
485
|
-
[[rules.
|
486
|
-
|
487
|
-
|
485
|
+
[[rules.filters]]
|
486
|
+
enclosing_node = "(block) @block"
|
487
|
+
not_contains = ["""
|
488
488
|
(
|
489
489
|
[
|
490
490
|
(short_var_declaration
|
@@ -12,15 +12,15 @@
|
|
12
12
|
[[scopes]]
|
13
13
|
name = "File"
|
14
14
|
[[scopes.rules]]
|
15
|
-
|
15
|
+
enclosing_node = """
|
16
16
|
(source_file) @source_file
|
17
17
|
"""
|
18
|
-
|
18
|
+
scope = """(source_file) @sf"""
|
19
19
|
|
20
20
|
[[scopes]]
|
21
21
|
name = "Function-Method"
|
22
22
|
[[scopes.rules]]
|
23
|
-
|
23
|
+
enclosing_node = """
|
24
24
|
(
|
25
25
|
(
|
26
26
|
[
|
@@ -36,7 +36,7 @@ matcher = """
|
|
36
36
|
) @f_decl1
|
37
37
|
)
|
38
38
|
"""
|
39
|
-
|
39
|
+
scope = """
|
40
40
|
(
|
41
41
|
(
|
42
42
|
[
|
@@ -486,9 +486,9 @@ query = """
|
|
486
486
|
replace = ""
|
487
487
|
replace_node = "enum_declaration"
|
488
488
|
is_seed_rule = false
|
489
|
-
[[rules.
|
490
|
-
|
491
|
-
|
489
|
+
[[rules.filters]]
|
490
|
+
enclosing_node = "(enum_declaration) @ed"
|
491
|
+
not_contains = ["(enum_constant) @ec"]
|
492
492
|
|
493
493
|
|
494
494
|
# This rule deltes all the content of the file if it contains
|
@@ -503,9 +503,9 @@ query = """(
|
|
503
503
|
replace = ""
|
504
504
|
replace_node = "program"
|
505
505
|
is_seed_rule = false
|
506
|
-
[[rules.
|
507
|
-
|
508
|
-
|
506
|
+
[[rules.filters]]
|
507
|
+
enclosing_node = "(program) @c_program"
|
508
|
+
not_contains = [
|
509
509
|
"(enum_declaration) @c_enum_declaration",
|
510
510
|
"(class_declaration) @c_class_declaration",
|
511
511
|
"(interface_declaration) @c_interface_declaration",
|
@@ -555,11 +555,11 @@ is_seed_rule = false
|
|
555
555
|
|
556
556
|
# Check if there is no assignment where the variable @variable_name is
|
557
557
|
# assigned to a value other than @init, within the method body
|
558
|
-
# Please note that the tree-sitter queries in the
|
558
|
+
# Please note that the tree-sitter queries in the filter uses holes (i.e. `@variable_name` and `@init`).
|
559
559
|
# These holes will be filled contextually based on the code snippet matched to `rule.query
|
560
|
-
[[rules.
|
561
|
-
|
562
|
-
|
560
|
+
[[rules.filters]]
|
561
|
+
enclosing_node = "[(method_declaration) (constructor_declaration)] @md"
|
562
|
+
not_contains = ["""
|
563
563
|
(
|
564
564
|
((assignment_expression
|
565
565
|
left: (_) @a.lhs
|
@@ -586,9 +586,9 @@ is_seed_rule = false
|
|
586
586
|
|
587
587
|
# Check if there is no assignment where the variable @variable_name is
|
588
588
|
# assigned to a value other than @init, within the method body
|
589
|
-
[[rules.
|
590
|
-
|
591
|
-
|
589
|
+
[[rules.filters]]
|
590
|
+
enclosing_node = "(class_declaration) @cd"
|
591
|
+
not_contains = ["""(
|
592
592
|
((assignment_expression
|
593
593
|
left: (_) @a.lhs
|
594
594
|
right: (_) @a.rhs) @assignment)
|
@@ -617,9 +617,9 @@ is_seed_rule = false
|
|
617
617
|
holes = ["variable_name", "init"]
|
618
618
|
# The enclosing methode declaration should not contain a local variable decalration named "@variable_name"
|
619
619
|
# which is initialized to "@init".
|
620
|
-
[[rules.
|
621
|
-
|
622
|
-
|
620
|
+
[[rules.filters]]
|
621
|
+
enclosing_node = "[(method_declaration) (constructor_declaration)] @md"
|
622
|
+
not_contains = ["""(
|
623
623
|
((local_variable_declaration
|
624
624
|
declarator: (variable_declarator
|
625
625
|
name: (_) @vdcl.lhs
|
@@ -645,9 +645,9 @@ replace = ""
|
|
645
645
|
replace_node = "expression_statement"
|
646
646
|
is_seed_rule = false
|
647
647
|
# The enclosing methode declaration should not contain a local variable decalration named "@variable_name"
|
648
|
-
[[rules.
|
649
|
-
|
650
|
-
|
648
|
+
[[rules.filters]]
|
649
|
+
enclosing_node = "(method_declaration) @md"
|
650
|
+
not_contains = [
|
651
651
|
"""(
|
652
652
|
((local_variable_declaration
|
653
653
|
declarator: (variable_declarator
|
@@ -656,11 +656,11 @@ queries = [
|
|
656
656
|
(#eq? @vdcl.lhs "@variable_name")
|
657
657
|
)""",
|
658
658
|
]
|
659
|
-
[[rules.
|
659
|
+
[[rules.filters]]
|
660
660
|
# There should exist no field declaration named `@variable_name` and
|
661
661
|
# there should be no assignments to @variable_name that are not same as `@init`.
|
662
|
-
|
663
|
-
|
662
|
+
enclosing_node = "(class_declaration) @cd"
|
663
|
+
not_contains = ["""(
|
664
664
|
((assignment_expression
|
665
665
|
left: (_) @a.lhs
|
666
666
|
right: (_) @a.rhs) @a)
|
@@ -677,7 +677,7 @@ queries = ["""(
|
|
677
677
|
|
678
678
|
# Replace identifier with value if :
|
679
679
|
# (i) There is no local variable declaration in the enclosing method with the name as the identifier
|
680
|
-
# TODO: Add field
|
680
|
+
# TODO: Add field filter
|
681
681
|
[[rules]]
|
682
682
|
name = "replace_identifier_with_value"
|
683
683
|
query = """
|
@@ -690,10 +690,10 @@ replace = "@init"
|
|
690
690
|
replace_node = "identifier"
|
691
691
|
holes = ["variable_name", "init"]
|
692
692
|
is_seed_rule = false
|
693
|
-
[[rules.
|
693
|
+
[[rules.filters]]
|
694
694
|
# There should exist no local variable declaration named `@identifer`
|
695
|
-
|
696
|
-
|
695
|
+
enclosing_node = "[(method_declaration) (constructor_declaration)] @md"
|
696
|
+
not_contains = ["""(
|
697
697
|
((local_variable_declaration
|
698
698
|
declarator: (variable_declarator
|
699
699
|
name: (_) @vdcl.lhs
|
@@ -17,11 +17,11 @@
|
|
17
17
|
# Each language has a syntax to define methods, classes, functions, therefore capturing such scopees is language dependent.
|
18
18
|
# This file allows users to define these language dependent scopes.
|
19
19
|
# Each scope consists of a scope name and a list of scope rules.
|
20
|
-
# Each scope rule consists of a `
|
20
|
+
# Each scope rule consists of a `enclosing_node` and a `scope`.
|
21
21
|
|
22
22
|
# When Piranha encounters a "Method" or "Class" scope, it looks up these configurations to obtain the list of scope rules.
|
23
23
|
# It then applies each `scope.rules.matcher` to the ancestors of changed node in the previous edit.
|
24
|
-
# Upon finding the match (it short-circuits), Piranha substitutes the tags in `scope.
|
24
|
+
# Upon finding the match (it short-circuits), Piranha substitutes the tags in `scope.rulesscope` based on the tag matches obtained from
|
25
25
|
# matching `scope.rules.matcher` to create a context specific rule for the changed node.
|
26
26
|
|
27
27
|
[[scopes]]
|
@@ -35,7 +35,7 @@ name = "Method"
|
|
35
35
|
#
|
36
36
|
# To capture the signature of the enclosing method, Piranha will match the below rule against the method.
|
37
37
|
# This will result in matches - { n: "foo", fp: "int a, int b, int c, int d, int e"}
|
38
|
-
# Substituting these matches in the `scopes.
|
38
|
+
# Substituting these matches in the `scopes.rulesscope` will result in :
|
39
39
|
#
|
40
40
|
#(((method_declaration
|
41
41
|
# name : (_) @z
|
@@ -45,7 +45,7 @@ name = "Method"
|
|
45
45
|
# (#eq? @tp "int a, int b, int c, int d, int e")
|
46
46
|
# )
|
47
47
|
#
|
48
|
-
|
48
|
+
enclosing_node = """
|
49
49
|
(
|
50
50
|
[(method_declaration
|
51
51
|
name : (_) @n
|
@@ -56,7 +56,7 @@ matcher = """
|
|
56
56
|
|
57
57
|
]
|
58
58
|
@xdn)"""
|
59
|
-
|
59
|
+
scope = """
|
60
60
|
(
|
61
61
|
[(((method_declaration
|
62
62
|
name : (_) @z
|
@@ -73,17 +73,17 @@ generator = """
|
|
73
73
|
]
|
74
74
|
)@qdn"""
|
75
75
|
|
76
|
-
# Scope
|
76
|
+
# Scope generator for Java Class.
|
77
77
|
[[scopes]]
|
78
78
|
name = "Class"
|
79
79
|
[[scopes.rules]]
|
80
|
-
|
80
|
+
enclosing_node = """(
|
81
81
|
[
|
82
82
|
(class_declaration name:(_) @n) @c
|
83
83
|
(enum_declaration name:(_) @n) @c
|
84
84
|
]
|
85
85
|
)"""
|
86
|
-
|
86
|
+
scope = """(
|
87
87
|
[
|
88
88
|
((class_declaration name:(_) @z) @qc)
|
89
89
|
((enum_declaration name:(_) @z) @qc)
|
@@ -96,7 +96,7 @@ generator = """(
|
|
96
96
|
[[scopes]]
|
97
97
|
name = "File"
|
98
98
|
[[scopes.rules]]
|
99
|
-
|
99
|
+
enclosing_node = """
|
100
100
|
(program) @c_u
|
101
101
|
"""
|
102
|
-
|
102
|
+
scope = "(program) @compilation_unit"
|