Skip to content

Fix call-seq return values#207

Merged
kou merged 1 commit into
ruby:masterfrom
zonuexe:fix-call-seq
May 21, 2026
Merged

Fix call-seq return values#207
kou merged 1 commit into
ruby:masterfrom
zonuexe:fix-call-seq

Conversation

@zonuexe
Copy link
Copy Markdown
Contributor

@zonuexe zonuexe commented May 21, 2026

Some call-seq comments did not match the actual return values (documentation only, no behavior change):

  • match? returns the match size, not a position
  • skip was missing the -> arrow
  • scan_full can also return a length
  • scan_byte can return nil at end of string

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the RDoc call-seq documentation in ext/strscan/strscan.c so the documented return values match the actual behavior of StringScanner methods (no runtime behavior changes).

Changes:

  • Correct match? to document returning match_size (length) rather than an updated position.
  • Fix skip call-seq formatting to include the -> return arrow.
  • Clarify scan_full may return either a matched substring or a length (or nil).
  • Clarify scan_byte can return nil at end-of-string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kou kou merged commit db4cc96 into ruby:master May 21, 2026
47 checks passed
@kou
Copy link
Copy Markdown
Member

kou commented May 21, 2026

Good catch!

matzbot pushed a commit to ruby/ruby that referenced this pull request May 21, 2026
(ruby/strscan#207)

Some `call-seq` comments did not match the actual return values
(documentation only, no behavior change):

* `match?` returns the match size, not a position
* `skip` was missing the `->` arrow
* `scan_full` can also return a length
* `scan_byte` can return `nil` at end of string

ruby/strscan@db4cc96c2e
@zonuexe zonuexe deleted the fix-call-seq branch May 21, 2026 11:32
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.

3 participants