Skip to content

Conversation

@sei40kr
Copy link
Contributor

@sei40kr sei40kr commented Jan 29, 2026

Summary

  • Add start_line() method to Location (Rust equivalent of Ruby's Location#start_line)
  • Add end_line() method to Location (Rust equivalent of Ruby's Location#end_line)
  • Add start_column() method to Location (Rust equivalent of Ruby's Location#start_column)
  • Add end_column() method to Location (Rust equivalent of Ruby's Location#end_column)
  • Add chop() method to Location (Rust equivalent of Ruby's Location#chop)

These methods use the C API pm_newline_list_line_column function to compute line and column numbers.

Public API Changes

Removed items from the public API
=================================
(none)

Changed items in the public API
===============================
(none)

Added items to the public API
=============================
+pub const fn ruby_prism::Location<'pr>::chop(&self) -> Self
+pub fn ruby_prism::Location<'pr>::end_column(&self) -> u32
+pub fn ruby_prism::Location<'pr>::end_line(&self) -> i32
+pub fn ruby_prism::Location<'pr>::start_column(&self) -> u32
+pub fn ruby_prism::Location<'pr>::start_line(&self) -> i32

Test plan

  • bundle exec rake cargo:test
  • bundle exec rake cargo:lint

🤖 Generated with Claude Code

sei40kr and others added 2 commits January 29, 2026 14:32
Port Ruby's `node_ext.rb` functionality to Rust bindings, providing
`full_name` and `full_name_parts` methods for `ConstantReadNode`,
`ConstantWriteNode`, `ConstantTargetNode`, `ConstantPathNode`, and
`ConstantPathTargetNode`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… `chop` methods for `Location`

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sei40kr sei40kr changed the title [rust] Add Location line/column and chop methods [rust] add Location line/column and chop methods Jan 29, 2026
@sei40kr sei40kr changed the title [rust] add Location line/column and chop methods [rust] add Location line/column and chop methods Jan 29, 2026
@sei40kr sei40kr marked this pull request as draft January 29, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant