instance method
Prism::ASCIISource#code_units_cache
code_units_cache(encoding)
lib/prism/parse_result.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/parse_result.rb, line 265
def code_units_cache(encoding)
->(byte_offset) { byte_offset }
end
Returns a cache that is the identity function in order to maintain the same interface. We can do this because code units are always equivalent to byte offsets for ASCII-only sources.