Changeset 19238
- Timestamp:
- 12/21/07 23:35:09 (13 months ago)
- Files:
-
- 1 modified
-
misc/pX/Common/Unicode/Unicode.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/pX/Common/Unicode/Unicode.pm
r19237 r19238 13 13 <Pc Pd Ps Pe Pi Pf Po P>, <Sm Sc Sk So S>, 14 14 <Zs Zl Zp Z>, <Cc Cf Cs Co Cn C>, 15 # Proplist.txt 16 <ASCII_Hex_Digit Bidi_Control Dash Deprecated Diacritic Extender Grapheme_Link>, 17 <Hex_Digit Hyphen Ideographic IDS_Binary_Operator IDS_Trinary_Operator Join_Control>, 18 <Logical_Order_Exception Noncharacter_Code_Point Other_Alphabetic>, 19 <Other_Default_Ignorable_Code_Point Other_Grapheme_Extend Other_ID_Continue>, 20 <Other_ID_Start Other_Lowercase Other_Math Other_Uppercase Pattern_Syntax>, 21 <Pattern_White_Space Quotation_Mark Radical Soft_Dotted STerm Terminal_Punctuation>, 22 <Unified_Ideograph Variation_Selector White_Space>, 23 # Perlish stuff 15 24 <alnum alpha ascii blank cntrl digit graph lower print>, 16 25 <punct space title upper xdigit word vspace hspace> … … 46 55 47 56 # ArabicShaping.txt 57 # post-6.0? 58 48 59 # BidiMirroring.txt 60 # 0 code 61 # 1 mirrored code 62 our Str %bidi_mirror; 63 49 64 # Blocks.txt 65 # 0 code range 66 # 1 block name 67 our Utable $blockname; 68 50 69 # CompositionExclusions.txt 70 # 0 code 71 our Bool %compex; 72 51 73 # CaseFolding.txt 74 # 0 code 75 # 1 status 76 # 2 mapping 77 our Str %casefold_stat; 78 our Str %casefold_map; 79 52 80 # DerivedAge.txt 81 # post-6.0? 82 53 83 # EastAsianWidth.txt 84 # post-6.0? 85 54 86 # HangulSyllableType.txt 87 # post-6.0? 88 55 89 # Jamo.txt 90 # post-6.0? 91 56 92 # LineBreak.txt 93 # post-6.0? 94 57 95 # NameAliases.txt 96 # 0 code 97 # 1 name 98 # see note about names in UnicodeData.txt 99 58 100 # NormalizationCorrections.txt 101 # 0 code 102 # 1 Original (erroneous) decomposition 103 # 2 Corrected decomposition 104 # 3 version corrected 105 59 106 # PropertyAliases.txt 107 # 0 abbrev 108 # 1 full name 109 # 2... more aliases 110 our Str %propalias; 111 60 112 # PropertyValueAliases.txt 113 # 0 prop 114 # 1 abbrev 115 # 2 full name 116 # -- for ccc --- 117 # 0 ccc 118 # 1 ccc num 119 # 2 abbrev 120 # 3 full name 121 our Hash of Str %pva; 122 ...; 123 61 124 # Scripts.txt 125 # 0 code range 126 # 1 script name 127 our Utable $script; 128 62 129 # SpecialCasing.txt 130 # 0 code 131 # 1 lower 132 # 2 title 133 # 3 upper 134 # 4 conditionals 135 our Str %upper_cond; 136 our Str %lower_cond; 137 our Str %title_cond; 138 our Str %case_cond; 139 63 140 # Unihan.txt 141 # post-6.0? 142 64 143 # DerivedCoreProperties.txt 65 144 # DerivedNormalizationProps.txt 145 66 146 # Proplist.txt 147 # 0 code range 148 # 1 prop name 149 67 150 # GraphemeBreakProperty.txt 151 # post-6.0? 152 68 153 # SentenceBreakProperty.txt 154 # post-6.0? 155 69 156 # WordBreakProperty.txt 157 # post-6.0? 158 70 159 71 160 class Utable { … … 82 171 @@.table = @@r; 83 172 @.val = @val; 84 $.preen if defined @val;173 $.preen; 85 174 } 86 175 multi submethod BUILD(Str $str) { … … 133 222 } 134 223 135 method lookup(Int $x --> Any) {224 method get(Int $x --> Any) { 136 225 return undef if !+@@.table; 137 226 return undef if $x < @@.table[0].min; … … 225 314 if ( $r.max >= $m.min and $r.min <= $m.min ) or ( $r.max >= $m.max and $r.min <= $m.max ) { 226 315 # $r and $m overlap 227 die "Utable::add: can't add overlapping ranges with a values" if defined $val; 316 die "Utable::add: can't add overlapping ranges with different values" 317 if $val !eqv @.val[$mid]; 228 318 $m = min($r.min, $m.min) .. max($r.max, $m.max); 229 319 $.preen if $preen; … … 247 337 } 248 338 last if $i == @@.table.elems-1; 249 # don't coalesce if we're storing values 250 if !+@.val and @@.table[$i].max >= @@.table[$i+1].min { 339 if @@.table[$i].max >= @@.table[$i+1].min and @.val[$i] eqv @.val[$i+1] { 251 340 @@.table.=splice: $i, 2, @@.table[$i].min .. @@.table[$i+1].max; 252 341 }
