tree_haver 2.0.0 → 3.1.0

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.
data/sig/tree_haver.rbs CHANGED
@@ -1,6 +1,9 @@
1
1
  # Type definitions for TreeHaver
2
2
  #
3
- # TreeHaver is a cross-Ruby adapter for the tree-sitter parsing library
3
+ # TreeHaver is a cross-Ruby adapter for code parsing with 10 backends:
4
+ # - Tree-sitter: MRI, Rust, FFI, Java
5
+ # - Native parsers: Prism (Ruby), Psych (YAML), Commonmarker (Markdown), Markly (GFM)
6
+ # - Pure Ruby: Citrus
4
7
 
5
8
  module TreeHaver
6
9
  VERSION: String
@@ -134,6 +137,20 @@ module TreeHaver
134
137
  # Get the end point (row, column)
135
138
  def end_point: () -> Point
136
139
 
140
+ # Position API - consistent across all backends
141
+ # Get 1-based line number where node starts
142
+ def start_line: () -> Integer
143
+
144
+ # Get 1-based line number where node ends
145
+ def end_line: () -> Integer
146
+
147
+ # Get complete position information as hash
148
+ # Returns {start_line:, end_line:, start_column:, end_column:}
149
+ def source_position: () -> Hash[Symbol, Integer]
150
+
151
+ # Get first child node (convenience method)
152
+ def first_child: () -> Node?
153
+
137
154
  # Get the number of child nodes
138
155
  def child_count: () -> Integer
139
156
 
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: 2.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -241,10 +241,15 @@ files:
241
241
  - SECURITY.md
242
242
  - lib/tree_haver.rb
243
243
  - lib/tree_haver/backends/citrus.rb
244
+ - lib/tree_haver/backends/commonmarker.rb
244
245
  - lib/tree_haver/backends/ffi.rb
245
246
  - lib/tree_haver/backends/java.rb
247
+ - lib/tree_haver/backends/markly.rb
246
248
  - lib/tree_haver/backends/mri.rb
249
+ - lib/tree_haver/backends/prism.rb
250
+ - lib/tree_haver/backends/psych.rb
247
251
  - lib/tree_haver/backends/rust.rb
252
+ - lib/tree_haver/citrus_grammar_finder.rb
248
253
  - lib/tree_haver/compat.rb
249
254
  - lib/tree_haver/grammar_finder.rb
250
255
  - lib/tree_haver/language_registry.rb
@@ -261,10 +266,10 @@ licenses:
261
266
  - MIT
262
267
  metadata:
263
268
  homepage_uri: https://tree-haver.galtzo.com/
264
- source_code_uri: https://github.com/kettle-rb/tree_haver/tree/v2.0.0
265
- changelog_uri: https://github.com/kettle-rb/tree_haver/blob/v2.0.0/CHANGELOG.md
269
+ source_code_uri: https://github.com/kettle-rb/tree_haver/tree/v3.1.0
270
+ changelog_uri: https://github.com/kettle-rb/tree_haver/blob/v3.1.0/CHANGELOG.md
266
271
  bug_tracker_uri: https://github.com/kettle-rb/tree_haver/issues
267
- documentation_uri: https://www.rubydoc.info/gems/tree_haver/2.0.0
272
+ documentation_uri: https://www.rubydoc.info/gems/tree_haver/3.1.0
268
273
  funding_uri: https://github.com/sponsors/pboling
269
274
  wiki_uri: https://github.com/kettle-rb/tree_haver/wiki
270
275
  news_uri: https://www.railsbling.com/tags/tree_haver
metadata.gz.sig CHANGED
Binary file