[buffer-deserialize-text] Accept initial comma

pull/4071/head
Behdad Esfahbod 2 years ago
parent 2c29b81e7f
commit 4268283e54
  1. 10
      src/hb-buffer-deserialize-json.hh
  2. 2
      src/hb-buffer-deserialize-json.rl
  3. 4
      src/hb-buffer-deserialize-text-glyphs.rl
  4. 4
      src/hb-buffer-deserialize-text-unicodes.rl

@ -548,21 +548,19 @@ _hb_buffer_deserialize_json (hb_buffer_t *buffer,
while (p < pe && ISSPACE (*p))
p++;
if (p < pe && *p == (buffer->len ? ',' : '['))
{
*end_ptr = ++p;
}
const char *tok = nullptr;
int cs;
hb_glyph_info_t info = {0};
hb_glyph_position_t pos = {0};
#line 554 "hb-buffer-deserialize-json.hh"
#line 552 "hb-buffer-deserialize-json.hh"
{
cs = deserialize_json_start;
}
#line 557 "hb-buffer-deserialize-json.hh"
#line 555 "hb-buffer-deserialize-json.hh"
{
int _slen;
int _trans;
@ -774,7 +772,7 @@ _resume:
*end_ptr = p;
}
break;
#line 735 "hb-buffer-deserialize-json.hh"
#line 733 "hb-buffer-deserialize-json.hh"
}
_again:
@ -786,7 +784,7 @@ _again:
_out: {}
}
#line 139 "hb-buffer-deserialize-json.rl"
#line 137 "hb-buffer-deserialize-json.rl"
*end_ptr = p;

@ -125,9 +125,7 @@ _hb_buffer_deserialize_json (hb_buffer_t *buffer,
while (p < pe && ISSPACE (*p))
p++;
if (p < pe && *p == (buffer->len ? ',' : '['))
{
*end_ptr = ++p;
}
const char *tok = nullptr;
int cs;

@ -93,7 +93,7 @@ glyph_item =
glyphs = glyph_item (space* '|' space* glyph_item)* space* ('|'|']');
main := space* '[' glyphs;
main := space* glyphs;
}%%
@ -111,6 +111,8 @@ _hb_buffer_deserialize_text_glyphs (hb_buffer_t *buffer,
while (p < pe && ISSPACE (*p))
p++;
if (p < pe && *p == (buffer->len ? ',' : '['))
*end_ptr = ++p;
const char *tok = nullptr;
int cs;

@ -75,7 +75,7 @@ unicode_item =
unicodes = unicode_item (space* '|' space* unicode_item)* space* ('|'|'>');
main := space* '<' unicodes;
main := space* unicodes;
}%%
@ -90,6 +90,8 @@ _hb_buffer_deserialize_text_unicodes (hb_buffer_t *buffer,
while (p < pe && ISSPACE (*p))
p++;
if (p < pe && *p == (buffer->len ? ',' : '<'))
*end_ptr = ++p;
const char *tok = nullptr;
int cs;

Loading…
Cancel
Save