Project

General

Profile

Actions

Bug #17139

closed

[doc] StringScanner#matched_size seems to be byte-oriented but that is not documented

Added by akostadinov (Aleksandar Kostadinov) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
[ruby-core:99820]

Description

StringScanner#matched_size seems to be byte oriented. But that is not documented. Better be documented to avoid confusion.

[1] pry(main)> ss = StringScanner.new([1024].pack("U*"))
[3] pry(main)> ss.skip_until(/./)
[4] pry(main)> ss.matched_size
=> 2
[5] pry(main)> ss.matched.size
=> 1

Actions

Also available in: Atom PDF

Like0
Like0