cached_start_code_units_offset(cache) -> IntegerRuby 3.4 から[permalink][rdoc][edit]-
キャッシュを使って、開始位置の、指定エンコーディングのコード単位でのオフセットを返します。
- [PARAM]
cache: - Prism::Result#code_units_cache で得たキャッシュを指定します。
require "prism" result = Prism.parse("x = \"あい\" + 1\n") loc = result.value.statements.body[0].location cache = result.code_units_cache(Encoding::UTF_16LE) p loc.cached_start_code_units_offset(cache) # => 0[SEE_ALSO] Prism::Result#code_units_cache
- [PARAM]