Changeset 4191


Ignore:
Timestamp:
Sep 24, 2014, 7:41:30 AM (5 years ago)
Author:
cameron
Message:

Generate missing sets

Location:
proto/charsetcompiler/UCD
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/charsetcompiler/UCD/UCD_properties.py

    r4190 r4191  
    332332           print "%s: %s bytes" % (basename, sum([value_map[v].bytes() for v in value_map.keys()]))
    333333           f.write("  namespace %s {\n" % property_code.upper())
     334           all_explicit_values = empty_uset()
     335           for v in self.property_value_list[property_code]:
     336             all_explicit_values = uset_union(all_explicit_values, value_map[v])
     337           missing_values = uset_complement(all_explicit_values)
     338           if self.missing_specs.has_key(property_code):
     339             default = canonicalize(self.missing_specs[property_code])
     340             if not self.property_value_lookup_map[property_code].has_key(default): raise Exception("Cannot process default specification '%s'" % default)
     341             default_key = self.property_value_lookup_map[property_code][default]
     342             value_map[default_key] = uset_union(value_map[default_key], missing_values) 
    334343           for v in self.property_value_list[property_code]:
    335344             f.write("    const UnicodeSet %s_Set \n" % v.lower())
    336345             f.write(value_map[v].showC(6) + ";\n")
     346           if not self.missing_specs.has_key(property_code):
     347             f.write("    const UnicodeSet Missing_Set \n")
     348             f.write(missing_values.showC(6) + ";\n")
    337349           set_list = ['%s_Set' % v.lower() for v in self.property_value_list[property_code]]
    338350           f.write("    const EnumeratedPropertyObject property_object\n")
  • proto/charsetcompiler/UCD/unicode_set.py

    r4186 r4191  
    132132        (this_run_type, this_run_length) = self.uSet.runs[self.run_no]
    133133        if this_run_type == Empty: return 0
    134         elif this_run_type == Full: return self.uSet.FullQuadMask
     134        elif this_run_type == Full: return FullQuadMask
    135135        else: return self.uSet.quads[self.quad_no]
    136136    def advance(self, n):
     
    175175      else:
    176176         for i in range(n):
    177             iset.append_quad(s.FullQuadMask ^ it.get_quad())
     177            iset.append_quad(FullQuadMask ^ it.get_quad())
    178178            it.advance(1)
    179179   return iset
     
    270270      elif s1_type == Full:
    271271         for i in range(n):
    272             iset.append_quad(iset.FullQuadMask ^ i2.get_quad())
     272            iset.append_quad(FullQuadMask ^ i2.get_quad())
    273273            i2.advance(1)
    274274         i1.advance(n)
     
    315315      elif s1_type == Full:
    316316         for i in range(n):
    317             iset.append_quad(iset.FullQuadMask ^ i2.get_quad())
     317            iset.append_quad(FullQuadMask ^ i2.get_quad())
    318318            i2.advance(1)
    319319         i1.advance(n)
    320320      elif s2_type == Full:
    321321         for i in range(n):
    322             iset.append_quad(iset.FullQuadMask ^ i1.get_quad())
     322            iset.append_quad(FullQuadMask ^ i1.get_quad())
    323323            i1.advance(1)
    324324         i2.advance(n)
Note: See TracChangeset for help on using the changeset viewer.