/[pcre]/code/trunk/maint/MultiStage2.py
ViewVC logotype

Diff of /code/trunk/maint/MultiStage2.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 941 by ph10, Sat Apr 30 17:37:37 2011 UTC revision 942 by ph10, Tue Feb 28 14:50:31 2012 UTC
# Line 121  def read_table(file_name, get_value, def Line 121  def read_table(file_name, get_value, def
121    
122  # Get the smallest possible C language type for the values  # Get the smallest possible C language type for the values
123  def get_type_size(table):  def get_type_size(table):
124          type_size = [("uschar", 1), ("pcre_uint16", 2), ("pcre_uint32", 4),          type_size = [("pcre_uint8", 1), ("pcre_uint16", 2), ("pcre_uint32", 4),
125                                   ("signed char", 1), ("pcre_int16", 2), ("pcre_int32", 4)]                                   ("signed char", 1), ("pcre_int16", 2), ("pcre_int32", 4)]
126          limits = [(0, 255), (0, 65535), (0, 4294967295),          limits = [(0, 255), (0, 65535), (0, 4294967295),
127                            (-128, 127), (-32768, 32767), (-2147483648, 2147483647)]                            (-128, 127), (-32768, 32767), (-2147483648, 2147483647)]
# Line 233  def test_record_size(): Line 233  def test_record_size():
233              #print struct              #print struct
234    
235  def print_records(records, record_size):  def print_records(records, record_size):
236          print 'const ucd_record _pcre_ucd_records[] = { ' + \          print 'const ucd_record PRIV(ucd_records)[] = { ' + \
237                '/* %d bytes, record size %d */' % (len(records) * record_size, record_size)                '/* %d bytes, record size %d */' % (len(records) * record_size, record_size)
238          records = zip(records.keys(), records.values())          records = zip(records.keys(), records.values())
239          records.sort(None, lambda x: x[1])          records.sort(None, lambda x: x[1])
# Line 258  script_names = ['Arabic', 'Armenian', 'B Line 258  script_names = ['Arabic', 'Armenian', 'B
258   'Javanese', 'Kaithi', 'Lisu', 'Meetei_Mayek', \   'Javanese', 'Kaithi', 'Lisu', 'Meetei_Mayek', \
259   'Old_South_Arabian', 'Old_Turkic', 'Samaritan', 'Tai_Tham', 'Tai_Viet', \   'Old_South_Arabian', 'Old_Turkic', 'Samaritan', 'Tai_Tham', 'Tai_Viet', \
260  # New for Unicode 6.0.0  # New for Unicode 6.0.0
261   'Batak', 'Brahmi', 'Mandaic'   'Batak', 'Brahmi', 'Mandaic', \
262    # New for Unicode 6.1.0
263     'Chakma', 'Meroitic_Cursive', 'Meroitic_Hieroglyphs', 'Miao', 'Sharada', 'Sora_Sompeng', 'Takri'
264   ]   ]
265    
266  category_names = ['Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu',  category_names = ['Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu',
# Line 307  print "/* a totally empty module because Line 309  print "/* a totally empty module because
309  print "/* Instead, just supply small dummy tables. */"  print "/* Instead, just supply small dummy tables. */"
310  print  print
311  print "#ifndef SUPPORT_UCP"  print "#ifndef SUPPORT_UCP"
312  print "const ucd_record _pcre_ucd_records[] = {{0,0,0 }};"  print "const ucd_record PRIV(ucd_records)[] = {{0,0,0 }};"
313  print "const uschar _pcre_ucd_stage1[] = {0};"  print "const pcre_uint8 PRIV(ucd_stage1)[] = {0};"
314  print "const pcre_uint16 _pcre_ucd_stage2[] = {0};"  print "const pcre_uint16 PRIV(ucd_stage2)[] = {0};"
315  print "#else"  print "#else"
316  print  print
317  print record_struct  print record_struct
318  print_records(records, record_size)  print_records(records, record_size)
319  print_table(min_stage1, '_pcre_ucd_stage1')  print_table(min_stage1, 'PRIV(ucd_stage1)')
320  print_table(min_stage2, '_pcre_ucd_stage2', min_block_size)  print_table(min_stage2, 'PRIV(ucd_stage2)', min_block_size)
321  print "#if UCD_BLOCK_SIZE != %d" % min_block_size  print "#if UCD_BLOCK_SIZE != %d" % min_block_size
322  print "#error Please correct UCD_BLOCK_SIZE in pcre_internal.h"  print "#error Please correct UCD_BLOCK_SIZE in pcre_internal.h"
323  print "#endif"  print "#endif"

Legend:
Removed from v.941  
changed lines
  Added in v.942

  ViewVC Help
Powered by ViewVC 1.1.5