Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MatchData #1568

Closed

Conversation

sampersand
Copy link
Contributor

@sampersand sampersand commented Oct 15, 2023

This PR updates MatchData and its associated tests, as well as adds String::_Match.

More specifically, this makes the following semantic updates:

  • MatchData::backref: Added, equal to String | Symbol | int
  • MatchData#[]: Updated to use backref, implicit ints, and range[int?]
  • MatchData#{begin,end,match,match_length,offset}: Updated to use backref
  • MatchData#deconstruct_keys: Named argument keys
  • MatchData#eql?: Now an alias for ==
  • MatchData#length: Now an alias for size
  • MatchData#named_captures: Added symbolize_names and annotation for >= 3.3.0
  • MatchData#values_at: Now uses backref and range[int?]
  • MatchData#initialize_copy: Takes an instance and returns void.

TODO: Add tests for [], values_at, and initialize_copy.

@sampersand sampersand force-pushed the swesterman/23-09-25/match_data branch from 890e95f to d487edf Compare October 15, 2023 23:05
@sampersand
Copy link
Contributor Author

Looks like this is already in master

@sampersand sampersand closed this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant