Imported Upstream version 3.4.0
[platform/upstream/harfbuzz.git] / src / gen-vowel-constraints.py
index 7f23dc8..42afd28 100755 (executable)
@@ -14,11 +14,9 @@ Input file:
 """
 
 import collections
-from html.parser import HTMLParser
 def write (s):
        sys.stdout.flush ()
        sys.stdout.buffer.write (s.encode ('utf-8'))
-import itertools
 import sys
 
 if len (sys.argv) != 3:
@@ -103,7 +101,7 @@ class ConstraintSet (object):
                                                self._indent (depth + 2), cp, index + i, ')' if i == len (self._c) - 1 else ' &&'))
                                s.append ('{}{{\n'.format (indent))
                                for i in range (index):
-                                       s.append ('{}buffer->next_glyph ();\n'.format (self._indent (depth + 1)))
+                                       s.append ('{}(void) buffer->next_glyph ();\n'.format (self._indent (depth + 1)))
                                s.append ('{}matched = true;\n'.format (self._indent (depth + 1)))
                                s.append ('{}}}\n'.format (indent))
                else:
@@ -173,15 +171,15 @@ print ()
 print ('static void')
 print ('_output_dotted_circle (hb_buffer_t *buffer)')
 print ('{')
-print ('  hb_glyph_info_t &dottedcircle = buffer->output_glyph (0x25CCu);')
-print ('  _hb_glyph_info_reset_continuation (&dottedcircle);')
+print ('  (void) buffer->output_glyph (0x25CCu);')
+print ('  _hb_glyph_info_reset_continuation (&buffer->prev());')
 print ('}')
 print ()
 print ('static void')
 print ('_output_with_dotted_circle (hb_buffer_t *buffer)')
 print ('{')
 print ('  _output_dotted_circle (buffer);')
-print ('  buffer->next_glyph ();')
+print ('  (void) buffer->next_glyph ();')
 print ('}')
 print ()
 
@@ -202,7 +200,6 @@ print ('   * collected from the USE script development spec.')
 print ('   *')
 print ('   * https://github.com/harfbuzz/harfbuzz/issues/1019')
 print ('   */')
-print ('  bool processed = false;')
 print ('  buffer->clear_output ();')
 print ('  unsigned int count = buffer->len;')
 print ('  switch ((unsigned) buffer->props.script)')
@@ -214,22 +211,16 @@ for script, constraints in sorted (constraints.items (), key=lambda s_c: script_
        print ('      {')
        print ('\tbool matched = false;')
        write (str (constraints))
-       print ('\tbuffer->next_glyph ();')
+       print ('\t(void) buffer->next_glyph ();')
        print ('\tif (matched) _output_with_dotted_circle (buffer);')
        print ('      }')
-       print ('      processed = true;')
        print ('      break;')
        print ()
 
 print ('    default:')
 print ('      break;')
 print ('  }')
-print ('  if (processed)')
-print ('  {')
-print ('    if (buffer->idx < count)')
-print ('      buffer->next_glyph ();')
-print ('    buffer->swap_buffers ();')
-print ('  }')
+print ('  buffer->sync ();')
 print ('}')
 
 print ()