Changeset 2229 for proto/charsetcompiler


Ignore:
Timestamp:
Jul 1, 2012, 11:31:24 AM (7 years ago)
Author:
cameron
Message:

Initial check-in: generator for transcoding classes

Location:
proto/charsetcompiler
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • proto/charsetcompiler/charset_compiler.py

    r1942 r2229  
    267267
    268268def make_bit_test(pattern, bit_count):
     269    if bit_count == 0: return TrueLiteral()
    269270    bit_terms = []
    270271    test_bit = 2**(bit_count - 1)
     
    330331        diff_bits >>= 1
    331332    if n2 < n1 or diff_count > 8: raise BadRange()
     333    mask = 2**(diff_count-1) - 1
    332334    common = make_bit_test(n1 >> diff_count, 8 - diff_count)
    333335    if diff_count == 0: return common
Note: See TracChangeset for help on using the changeset viewer.