Issue #17139 has been reported by akostadinov (Aleksandar Kostadinov).

----------------------------------------
Bug #17139: [doc] StringScanner#matched_size seems to be byte-oriented but that is not documented
https://bugs.ruby-lang.org/issues/17139

* Author: akostadinov (Aleksandar Kostadinov)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
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



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>