[vowel-constraints] Simplify generated code
Fixes https://github.com/harfbuzz/harfbuzz/issues/2385
This commit is contained in:
parent
665483c979
commit
28633b1979
|
@ -103,9 +103,9 @@ class ConstraintSet (object):
|
||||||
s.append ('{}0x{:04X}u == buffer->cur ({}).codepoint{}\n'.format (
|
s.append ('{}0x{:04X}u == buffer->cur ({}).codepoint{}\n'.format (
|
||||||
self._indent (depth + 2), cp, index + i, ')' if i == len (self._c) - 1 else ' &&'))
|
self._indent (depth + 2), cp, index + i, ')' if i == len (self._c) - 1 else ' &&'))
|
||||||
s.append ('{}{{\n'.format (indent))
|
s.append ('{}{{\n'.format (indent))
|
||||||
for i in range (index + 1):
|
for i in range (index):
|
||||||
s.append ('{}buffer->next_glyph ();\n'.format (self._indent (depth + 1)))
|
s.append ('{}buffer->next_glyph ();\n'.format (self._indent (depth + 1)))
|
||||||
s.append ('{}_output_dotted_circle (buffer);\n'.format (self._indent (depth + 1)))
|
s.append ('{}matched = true;\n'.format (self._indent (depth + 1)))
|
||||||
s.append ('{}}}\n'.format (indent))
|
s.append ('{}}}\n'.format (indent))
|
||||||
else:
|
else:
|
||||||
s.append ('{}switch (buffer->cur ({}).codepoint)\n'.format(indent, index or ''))
|
s.append ('{}switch (buffer->cur ({}).codepoint)\n'.format(indent, index or ''))
|
||||||
|
|
|
@ -98,8 +98,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
|
||||||
0x0907u == buffer->cur (2).codepoint)
|
0x0907u == buffer->cur (2).codepoint)
|
||||||
{
|
{
|
||||||
buffer->next_glyph ();
|
buffer->next_glyph ();
|
||||||
buffer->next_glyph ();
|
matched = true;
|
||||||
_output_dotted_circle (buffer);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -219,8 +218,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
|
||||||
if (0x0B85u == buffer->cur ().codepoint &&
|
if (0x0B85u == buffer->cur ().codepoint &&
|
||||||
0x0BC2u == buffer->cur (1).codepoint)
|
0x0BC2u == buffer->cur (1).codepoint)
|
||||||
{
|
{
|
||||||
buffer->next_glyph ();
|
matched = true;
|
||||||
_output_dotted_circle (buffer);
|
|
||||||
}
|
}
|
||||||
buffer->next_glyph ();
|
buffer->next_glyph ();
|
||||||
if (matched) _output_with_dotted_circle (buffer);
|
if (matched) _output_with_dotted_circle (buffer);
|
||||||
|
|
Loading…
Reference in New Issue