зеркало из https://github.com/github/ruby.git
[ruby/prism] Add macThai
https://github.com/ruby/prism/commit/f654058f50
This commit is contained in:
Родитель
0a081a33eb
Коммит
50b7b927a3
|
@ -194,6 +194,7 @@ extern pm_encoding_t pm_encoding_mac_greek;
|
||||||
extern pm_encoding_t pm_encoding_mac_iceland;
|
extern pm_encoding_t pm_encoding_mac_iceland;
|
||||||
extern pm_encoding_t pm_encoding_mac_roman;
|
extern pm_encoding_t pm_encoding_mac_roman;
|
||||||
extern pm_encoding_t pm_encoding_mac_romania;
|
extern pm_encoding_t pm_encoding_mac_romania;
|
||||||
|
extern pm_encoding_t pm_encoding_mac_thai;
|
||||||
extern pm_encoding_t pm_encoding_mac_turkish;
|
extern pm_encoding_t pm_encoding_mac_turkish;
|
||||||
extern pm_encoding_t pm_encoding_mac_ukraine;
|
extern pm_encoding_t pm_encoding_mac_ukraine;
|
||||||
extern pm_encoding_t pm_encoding_shift_jis;
|
extern pm_encoding_t pm_encoding_shift_jis;
|
||||||
|
|
|
@ -816,6 +816,30 @@ static uint8_t pm_encoding_mac_romania_table[256] = {
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Fx
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Fx
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Each element of the following table contains a bitfield that indicates a
|
||||||
|
* piece of information about the corresponding macThai character.
|
||||||
|
*/
|
||||||
|
static uint8_t pm_encoding_mac_thai_table[256] = {
|
||||||
|
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2x
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, // 3x
|
||||||
|
0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 4x
|
||||||
|
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, // 5x
|
||||||
|
0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 6x
|
||||||
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, // 7x
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Ax
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Bx
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Cx
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Dx
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Ex
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Fx
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Each element of the following table contains a bitfield that indicates a
|
* Each element of the following table contains a bitfield that indicates a
|
||||||
* piece of information about the corresponding macTurkish character.
|
* piece of information about the corresponding macTurkish character.
|
||||||
|
@ -1178,6 +1202,7 @@ PRISM_ENCODING_TABLE(mac_greek)
|
||||||
PRISM_ENCODING_TABLE(mac_iceland)
|
PRISM_ENCODING_TABLE(mac_iceland)
|
||||||
PRISM_ENCODING_TABLE(mac_roman)
|
PRISM_ENCODING_TABLE(mac_roman)
|
||||||
PRISM_ENCODING_TABLE(mac_romania)
|
PRISM_ENCODING_TABLE(mac_romania)
|
||||||
|
PRISM_ENCODING_TABLE(mac_thai)
|
||||||
PRISM_ENCODING_TABLE(mac_turkish)
|
PRISM_ENCODING_TABLE(mac_turkish)
|
||||||
PRISM_ENCODING_TABLE(mac_ukraine)
|
PRISM_ENCODING_TABLE(mac_ukraine)
|
||||||
PRISM_ENCODING_TABLE(windows_1250)
|
PRISM_ENCODING_TABLE(windows_1250)
|
||||||
|
@ -1542,6 +1567,16 @@ pm_encoding_t pm_encoding_mac_romania = {
|
||||||
.multibyte = false
|
.multibyte = false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** macThai */
|
||||||
|
pm_encoding_t pm_encoding_mac_thai = {
|
||||||
|
.name = "macThai",
|
||||||
|
.char_width = pm_encoding_single_char_width,
|
||||||
|
.alnum_char = pm_encoding_mac_thai_alnum_char,
|
||||||
|
.alpha_char = pm_encoding_mac_thai_alpha_char,
|
||||||
|
.isupper_char = pm_encoding_mac_thai_isupper_char,
|
||||||
|
.multibyte = false
|
||||||
|
};
|
||||||
|
|
||||||
/** macTurkish */
|
/** macTurkish */
|
||||||
pm_encoding_t pm_encoding_mac_turkish = {
|
pm_encoding_t pm_encoding_mac_turkish = {
|
||||||
.name = "macTurkish",
|
.name = "macTurkish",
|
||||||
|
|
|
@ -6139,6 +6139,7 @@ parser_lex_magic_comment_encoding_value(pm_parser_t *parser, const uint8_t *star
|
||||||
ENCODING1("macIceland", pm_encoding_mac_iceland);
|
ENCODING1("macIceland", pm_encoding_mac_iceland);
|
||||||
ENCODING1("macRoman", pm_encoding_mac_roman);
|
ENCODING1("macRoman", pm_encoding_mac_roman);
|
||||||
ENCODING1("macRomania", pm_encoding_mac_romania);
|
ENCODING1("macRomania", pm_encoding_mac_romania);
|
||||||
|
ENCODING1("macThai", pm_encoding_mac_thai);
|
||||||
ENCODING1("macTurkish", pm_encoding_mac_turkish);
|
ENCODING1("macTurkish", pm_encoding_mac_turkish);
|
||||||
ENCODING1("macUkraine", pm_encoding_mac_ukraine);
|
ENCODING1("macUkraine", pm_encoding_mac_ukraine);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -42,6 +42,7 @@ module Prism
|
||||||
Encoding::MACICELAND => 0x00...0x100,
|
Encoding::MACICELAND => 0x00...0x100,
|
||||||
Encoding::MACROMAN => 0x00...0x100,
|
Encoding::MACROMAN => 0x00...0x100,
|
||||||
Encoding::MACROMANIA => 0x00...0x100,
|
Encoding::MACROMANIA => 0x00...0x100,
|
||||||
|
Encoding::MACTHAI => 0x00...0x100,
|
||||||
Encoding::MACTURKISH => 0x00...0x100,
|
Encoding::MACTURKISH => 0x00...0x100,
|
||||||
Encoding::Windows_1250 => 0x00...0x100,
|
Encoding::Windows_1250 => 0x00...0x100,
|
||||||
Encoding::Windows_1251 => 0x00...0x100,
|
Encoding::Windows_1251 => 0x00...0x100,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче