☰
Debian Codegraph
@
1.9.0-3
/
/
lib
/
prism
/
polyfill
/
scan_byte.rb
☽
☼
lib/prism/polyfill/scan_byte.rb
code
plain
raw
symbols
SCIP
Expat
2022-2026 Shopify Inc.
debian/copyright
1
# frozen_string_literal: true
2
3
require
"strscan"
4
5
# Polyfill for StringScanner#scan_byte, which didn't exist until Ruby 3.4.
6
if
!(
StringScanner
.
method_defined?
(
:scan_byte
))
7
StringScanner
.
include
(
8
Module
.
new
{
9
def
scan_byte
# :nodoc:
10
get_byte
&.
b
&.
ord
11
end
12
}
13
)
14
end