class Prism::ASCIISource
include multibyte characters are represented by the Prism::Source class.
cannot be applied to sources that include multibyte characters. Sources that
characters only. This class is used to apply performance optimizations that
Specialized version of Prism::Source for source code that includes ASCII
def character_column(byte_offset)
def character_column(byte_offset) byte_offset - line_start(byte_offset) end
def character_offset(byte_offset)
def character_offset(byte_offset) byte_offset end
def code_units_column(byte_offset, encoding)
`code_units_offset`, which is a more expensive operation. This is
Specialized version of `code_units_column` that does not depend on
def code_units_column(byte_offset, encoding) byte_offset - line_start(byte_offset) end
def code_units_offset(byte_offset, encoding)
concept of code units that differs from the number of characters in other
This method is tested with UTF-8, UTF-16, and UTF-32. If there is the
counting in code units for the given encoding.
Returns the offset from the start of the file for the given byte offset
def code_units_offset(byte_offset, encoding) byte_offset end