Prism Ruby parser
|
This struct defines the functions necessary to implement the encoding interface so we can determine how many bytes the subsequent character takes. More...
#include <encoding.h>
Data Fields | |
size_t(* | char_width )(const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding. | |
size_t(* | alpha_char )(const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphabetical. | |
size_t(* | alnum_char )(const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphanumeric. | |
bool(* | isupper_char )(const uint8_t *b, ptrdiff_t n) |
Return true if the next character is valid in the encoding and is an uppercase character. | |
const char * | name |
The name of the encoding. | |
bool | multibyte |
Return true if the encoding is a multibyte encoding. | |
This struct defines the functions necessary to implement the encoding interface so we can determine how many bytes the subsequent character takes.
Each callback should return the number of bytes, or 0 if the next bytes are invalid for the encoding and type.
size_t(* pm_encoding_t::char_width) (const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding.
Does not read more than n bytes. It is assumed that n is at least 1.
size_t(* pm_encoding_t::alpha_char) (const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphabetical.
Does not read more than n bytes. It is assumed that n is at least 1.
size_t(* pm_encoding_t::alnum_char) (const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphanumeric.
Does not read more than n bytes. It is assumed that n is at least 1.
bool(* pm_encoding_t::isupper_char) (const uint8_t *b, ptrdiff_t n) |
Return true if the next character is valid in the encoding and is an uppercase character.
Does not read more than n bytes. It is assumed that n is at least 1.
const char* pm_encoding_t::name |
The name of the encoding.
This should correspond to a value that can be passed to Encoding.find in Ruby.