[hb-buffer-deserialize-text-unicode] Relax parsing

This commit is contained in:
Behdad Esfahbod 2023-01-23 21:10:11 -07:00
parent 328ee9b4ad
commit 32afdcdb46
2 changed files with 64 additions and 48 deletions

View File

@ -34,18 +34,18 @@
#line 33 "hb-buffer-deserialize-text-unicode.hh"
static const unsigned char _deserialize_text_unicode_trans_keys[] = {
0u, 0u, 9u, 85u, 43u, 43u, 48u, 102u, 9u, 124u, 9u, 124u, 48u, 57u, 9u, 124u,
9u, 124u, 0u, 0u, 9u, 85u, 0
0u, 0u, 9u, 117u, 43u, 102u, 48u, 102u, 9u, 124u, 9u, 124u, 48u, 57u, 9u, 124u,
9u, 124u, 0u, 0u, 9u, 117u, 0
};
static const char _deserialize_text_unicode_key_spans[] = {
0, 77, 1, 55, 116, 116, 10, 116,
116, 0, 77
0, 109, 60, 55, 116, 116, 10, 116,
116, 0, 109
};
static const short _deserialize_text_unicode_index_offsets[] = {
0, 0, 78, 80, 136, 253, 370, 381,
498, 615, 616
0, 0, 110, 171, 227, 344, 461, 472,
589, 706, 707
};
static const char _deserialize_text_unicode_indicies[] = {
@ -58,36 +58,47 @@ static const char _deserialize_text_unicode_indicies[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 1, 3,
1, 4, 4, 4, 4, 4, 4, 4,
1, 1, 1, 1, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1,
1, 1, 1, 1, 1, 4, 4, 4,
4, 4, 4, 1, 1, 1, 1, 1,
1, 1, 4, 4, 4, 4, 4, 4,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 4, 4,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1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
@ -95,14 +106,29 @@ static const char _deserialize_text_unicode_indicies[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 12, 1, 13, 14, 14, 14, 14,
14, 14, 14, 14, 14, 1, 15, 15,
1, 1, 1, 1, 12, 1, 13, 14,
14, 14, 14, 14, 14, 14, 14, 14,
1, 15, 15, 15, 15, 15, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
15, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 16, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 17, 1, 15, 15,
15, 15, 15, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 15, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 18, 18, 18,
18, 18, 18, 18, 18, 18, 18, 1,
1, 1, 1, 16, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
@ -111,31 +137,21 @@ static const char _deserialize_text_unicode_indicies[] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 17, 1, 15, 15, 15, 15, 15,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 15, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 18, 18, 18, 18, 18, 18,
18, 18, 18, 18, 1, 1, 1, 1,
16, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 17, 1,
1, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 17, 1, 1, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 1, 0
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
2, 1, 0
};
static const char _deserialize_text_unicode_trans_targs[] = {
@ -179,12 +195,12 @@ _hb_buffer_deserialize_text_unicode (hb_buffer_t *buffer,
hb_glyph_info_t info = {0};
const hb_glyph_position_t pos = {0};
#line 176 "hb-buffer-deserialize-text-unicode.hh"
#line 192 "hb-buffer-deserialize-text-unicode.hh"
{
cs = deserialize_text_unicode_start;
}
#line 179 "hb-buffer-deserialize-text-unicode.hh"
#line 195 "hb-buffer-deserialize-text-unicode.hh"
{
int _slen;
int _trans;
@ -251,7 +267,7 @@ _resume:
*end_ptr = p;
}
break;
#line 238 "hb-buffer-deserialize-text-unicode.hh"
#line 254 "hb-buffer-deserialize-text-unicode.hh"
}
_again:

View File

@ -61,7 +61,7 @@ num = '-'? unum;
cluster = '=' (unum >tok %parse_cluster);
unicode = 'U' '+' xdigit+ >tok %parse_hexdigits;
unicode = [Uu] '+'? xdigit+ >tok %parse_hexdigits;
unicode_item =
(