@@ -317,23 +317,6 @@ def emit_property_module(f, mod, tbl, emit_fn):
317
317
f .write (" }\n \n " )
318
318
f .write ("}\n \n " )
319
319
320
- def emit_regex_module (f , cats , w_data ):
321
- f .write ("pub mod regex {\n " )
322
- regex_class = "&'static [(char, char)]"
323
- class_table = "&'static [(&'static str, %s)]" % regex_class
324
-
325
- emit_table (f , "UNICODE_CLASSES" , cats , class_table ,
326
- pfun = lambda x : "(\" %s\" ,super::%s::%s_table)" % (x [0 ], x [1 ], x [0 ]))
327
-
328
- f .write (" pub const PERLD: %s = super::general_category::Nd_table;\n \n "
329
- % regex_class )
330
- f .write (" pub const PERLS: %s = super::property::White_Space_table;\n \n "
331
- % regex_class )
332
-
333
- emit_table (f , "PERLW" , w_data , regex_class )
334
-
335
- f .write ("}\n \n " )
336
-
337
320
def emit_conversions_module (f , lowerupper , upperlower ):
338
321
f .write ("pub mod conversions {" )
339
322
f .write ("""
@@ -616,27 +599,12 @@ def optimize_width_table(wtable):
616
599
# bsearch_range_table is used in all the property modules below
617
600
emit_bsearch_range_table (rf )
618
601
619
- # all of these categories will also be available as \p{} in libregex
620
- allcats = []
602
+ # category tables
621
603
for (name , cat , pfuns ) in ("general_category" , gencats , ["N" , "Cc" ]), \
622
604
("derived_property" , derived , want_derived ), \
623
605
("script" , scripts , []), \
624
606
("property" , props , ["White_Space" ]):
625
607
emit_property_module (rf , name , cat , pfuns )
626
- allcats .extend (map (lambda x : (x , name ), cat ))
627
- allcats .sort (key = lambda c : c [0 ])
628
-
629
- # the \w regex corresponds to Alphabetic + Mark + Decimal_Number +
630
- # Connector_Punctuation + Join-Control according to UTS#18
631
- # http://www.unicode.org/reports/tr18/#Compatibility_Properties
632
- perl_words = []
633
- for cat in derived ["Alphabetic" ], gencats ["M" ], gencats ["Nd" ], \
634
- gencats ["Pc" ], props ["Join_Control" ]:
635
- perl_words .extend (ungroup_cat (cat ))
636
- perl_words = group_cat (perl_words )
637
-
638
- # emit lookup tables for \p{}, along with \d, \w, and \s for libregex
639
- emit_regex_module (rf , allcats , perl_words )
640
608
641
609
# normalizations and conversions module
642
610
emit_norm_module (rf , canon_decomp , compat_decomp , combines , norm_props )
0 commit comments