Changeset 3949 for proto/charsetcompiler


Ignore:
Timestamp:
Aug 2, 2014, 5:01:35 PM (5 years ago)
Author:
cameron
Message:

Add CanonicalCharSetDef? constructor, default UTF-8 basis pattern

Location:
proto/charsetcompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/charsetcompiler/UTF_encoding.py

    r3413 r3949  
    77   bits=8
    88   mask=0xFF
     9   basis_pattern = "basis_bits.bit_%i"
    910
    1011class UTF16:
     
    2324        self.bits = bits
    2425        self.mask = mask
     26        self.basis_pattern = []
    2527        self.default = default
    2628        self.locked = locked
    27         self.basis_pattern = []
    2829        self.encoding_error = False
    2930    def __str__(self): return self.name
  • proto/charsetcompiler/charset_def.py

    r3944 r3949  
    3232        else: return "CharDef(%s, '\\%X')" % (self.name, ord(self.items[0]))
    3333
     34class CanonicalCharSetDef(CharSetDef):
     35    def __init__(self, name, items, invert = False):
     36        self.name = name
     37        self.items = items
     38        self.complemented = invert
     39
     40
    3441def canonical_range_list(items):
    3542    if items == []: return []
Note: See TracChangeset for help on using the changeset viewer.