tree_haver 3.2.5 → 3.2.6
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +17 -1
- data/lib/tree_haver/backends/java.rb +53 -10
- data/lib/tree_haver/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e544c31dc86e71be78cfcf24e7cbf8a779ef954845b736ec37ed6b550ffe714
|
|
4
|
+
data.tar.gz: 54f83ef36c8167f5071db278ce33f2603864d339a9c246a733957da41540eab4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c991da086ba12a279f461f337e7dfa9d0b98d8d6d4f4c5d3d78cc3b848a6174ed42ce71b674e8a2d4ed81c5b17289d6c3903c2ef813db86cd4557a33aa1c1599
|
|
7
|
+
data.tar.gz: 034b9f7df24e5f757013f011b7661559fed243b3fde752d95ab2cac94a0fdfc8270d9ca002d07972c74c1d5455293ac12c7472eacdc106934051cc3231d005b9
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,20 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [3.2.6] - 2026-01-06
|
|
34
|
+
|
|
35
|
+
- TAG: [v3.2.6][3.2.6t]
|
|
36
|
+
- COVERAGE: 92.07% -- 2230/2422 lines in 23 files
|
|
37
|
+
- BRANCH COVERAGE: 74.69% -- 788/1055 branches in 23 files
|
|
38
|
+
- 90.37% documented
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- **Java backend**: Fixed Optional handling in Node methods that could return nil incorrectly
|
|
43
|
+
- `child(index)`, `child_by_field_name(name)`, `parent`, `next_sibling`, `prev_sibling` now properly check for nil before attempting to unwrap Java Optional
|
|
44
|
+
- Previously, the ternary-based Optional check could fail when jtreesitter returned null directly instead of Optional.empty()
|
|
45
|
+
- This fixes JRuby test failures where `key_name` returned nil and object keys were not extracted
|
|
46
|
+
|
|
33
47
|
## [3.2.5] - 2026-01-05
|
|
34
48
|
|
|
35
49
|
- TAG: [v3.2.5][3.2.5t]
|
|
@@ -901,7 +915,9 @@ Despite the major version bump to 3.0.0 (following semver due to the breaking `L
|
|
|
901
915
|
|
|
902
916
|
- Initial release
|
|
903
917
|
|
|
904
|
-
[Unreleased]: https://github.com/kettle-rb/tree_haver/compare/v3.2.
|
|
918
|
+
[Unreleased]: https://github.com/kettle-rb/tree_haver/compare/v3.2.6...HEAD
|
|
919
|
+
[3.2.6]: https://github.com/kettle-rb/tree_haver/compare/v3.2.5...v3.2.6
|
|
920
|
+
[3.2.6t]: https://github.com/kettle-rb/tree_haver/releases/tag/v3.2.6
|
|
905
921
|
[3.2.5]: https://github.com/kettle-rb/tree_haver/compare/v3.2.4...v3.2.5
|
|
906
922
|
[3.2.5t]: https://github.com/kettle-rb/tree_haver/releases/tag/v3.2.5
|
|
907
923
|
[3.2.4]: https://github.com/kettle-rb/tree_haver/compare/v3.2.3...v3.2.4
|
|
@@ -640,8 +640,17 @@ module TreeHaver
|
|
|
640
640
|
def child(index)
|
|
641
641
|
# jtreesitter 0.26.0: getChild returns Optional<Node> or throws IndexOutOfBoundsException
|
|
642
642
|
result = @impl.getChild(index)
|
|
643
|
-
return
|
|
644
|
-
|
|
643
|
+
return if result.nil?
|
|
644
|
+
|
|
645
|
+
# Handle Java Optional
|
|
646
|
+
if result.respond_to?(:isPresent)
|
|
647
|
+
return unless result.isPresent
|
|
648
|
+
java_node = result.get
|
|
649
|
+
else
|
|
650
|
+
# Direct Node return (some jtreesitter versions)
|
|
651
|
+
java_node = result
|
|
652
|
+
end
|
|
653
|
+
|
|
645
654
|
Node.new(java_node)
|
|
646
655
|
rescue ::Java::JavaLang::IndexOutOfBoundsException
|
|
647
656
|
nil
|
|
@@ -653,9 +662,19 @@ module TreeHaver
|
|
|
653
662
|
# @return [Node, nil] the child node or nil if not found
|
|
654
663
|
def child_by_field_name(name)
|
|
655
664
|
# jtreesitter 0.26.0: getChildByFieldName returns Optional<Node>
|
|
665
|
+
# However, some versions or scenarios may return null directly
|
|
656
666
|
result = @impl.getChildByFieldName(name)
|
|
657
|
-
return
|
|
658
|
-
|
|
667
|
+
return if result.nil?
|
|
668
|
+
|
|
669
|
+
# Handle Java Optional
|
|
670
|
+
if result.respond_to?(:isPresent)
|
|
671
|
+
return unless result.isPresent
|
|
672
|
+
java_node = result.get
|
|
673
|
+
else
|
|
674
|
+
# Direct Node return (some jtreesitter versions)
|
|
675
|
+
java_node = result
|
|
676
|
+
end
|
|
677
|
+
|
|
659
678
|
Node.new(java_node)
|
|
660
679
|
end
|
|
661
680
|
|
|
@@ -727,8 +746,16 @@ module TreeHaver
|
|
|
727
746
|
def parent
|
|
728
747
|
# jtreesitter 0.26.0: getParent returns Optional<Node>
|
|
729
748
|
result = @impl.getParent
|
|
730
|
-
return
|
|
731
|
-
|
|
749
|
+
return if result.nil?
|
|
750
|
+
|
|
751
|
+
# Handle Java Optional
|
|
752
|
+
if result.respond_to?(:isPresent)
|
|
753
|
+
return unless result.isPresent
|
|
754
|
+
java_node = result.get
|
|
755
|
+
else
|
|
756
|
+
java_node = result
|
|
757
|
+
end
|
|
758
|
+
|
|
732
759
|
Node.new(java_node)
|
|
733
760
|
end
|
|
734
761
|
|
|
@@ -738,8 +765,16 @@ module TreeHaver
|
|
|
738
765
|
def next_sibling
|
|
739
766
|
# jtreesitter 0.26.0: getNextSibling returns Optional<Node>
|
|
740
767
|
result = @impl.getNextSibling
|
|
741
|
-
return
|
|
742
|
-
|
|
768
|
+
return if result.nil?
|
|
769
|
+
|
|
770
|
+
# Handle Java Optional
|
|
771
|
+
if result.respond_to?(:isPresent)
|
|
772
|
+
return unless result.isPresent
|
|
773
|
+
java_node = result.get
|
|
774
|
+
else
|
|
775
|
+
java_node = result
|
|
776
|
+
end
|
|
777
|
+
|
|
743
778
|
Node.new(java_node)
|
|
744
779
|
end
|
|
745
780
|
|
|
@@ -749,8 +784,16 @@ module TreeHaver
|
|
|
749
784
|
def prev_sibling
|
|
750
785
|
# jtreesitter 0.26.0: getPrevSibling returns Optional<Node>
|
|
751
786
|
result = @impl.getPrevSibling
|
|
752
|
-
return
|
|
753
|
-
|
|
787
|
+
return if result.nil?
|
|
788
|
+
|
|
789
|
+
# Handle Java Optional
|
|
790
|
+
if result.respond_to?(:isPresent)
|
|
791
|
+
return unless result.isPresent
|
|
792
|
+
java_node = result.get
|
|
793
|
+
else
|
|
794
|
+
java_node = result
|
|
795
|
+
end
|
|
796
|
+
|
|
754
797
|
Node.new(java_node)
|
|
755
798
|
end
|
|
756
799
|
|
data/lib/tree_haver/version.rb
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tree_haver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -293,10 +293,10 @@ licenses:
|
|
|
293
293
|
- MIT
|
|
294
294
|
metadata:
|
|
295
295
|
homepage_uri: https://tree-haver.galtzo.com/
|
|
296
|
-
source_code_uri: https://github.com/kettle-rb/tree_haver/tree/v3.2.
|
|
297
|
-
changelog_uri: https://github.com/kettle-rb/tree_haver/blob/v3.2.
|
|
296
|
+
source_code_uri: https://github.com/kettle-rb/tree_haver/tree/v3.2.6
|
|
297
|
+
changelog_uri: https://github.com/kettle-rb/tree_haver/blob/v3.2.6/CHANGELOG.md
|
|
298
298
|
bug_tracker_uri: https://github.com/kettle-rb/tree_haver/issues
|
|
299
|
-
documentation_uri: https://www.rubydoc.info/gems/tree_haver/3.2.
|
|
299
|
+
documentation_uri: https://www.rubydoc.info/gems/tree_haver/3.2.6
|
|
300
300
|
funding_uri: https://github.com/sponsors/pboling
|
|
301
301
|
wiki_uri: https://github.com/kettle-rb/tree_haver/wiki
|
|
302
302
|
news_uri: https://www.railsbling.com/tags/tree_haver
|
metadata.gz.sig
CHANGED
|
Binary file
|