File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -367,14 +367,22 @@ function parseSpecialCasing(UnicodeData $data, string $input) : void {
367
367
368
368
function parseDerivedCoreProperties (UnicodeData $ data , string $ input ) : void {
369
369
foreach (parseDataFile ($ input ) as $ fields ) {
370
- if (count ($ fields ) != 2 ) {
371
- throw new Exception ("Line does not contain 2 fields " );
370
+ $ fieldCount = count ($ fields );
371
+ if ($ fieldCount != 2 && $ fieldCount !== 3 ) {
372
+ throw new Exception ("Line does not contain 2 or 3 fields " );
372
373
}
373
374
374
- $ property = $ fields [1 ];
375
- if ($ property != 'Cased ' && $ property != 'Case_Ignorable ' ) {
375
+ $ usedProperties = ['Cased ' , 'Case_Ignorable ' ];
376
+ if (isset ($ fields [2 ]) && in_array ($ fields [2 ], $ usedProperties , true )) {
377
+ $ property = $ fields [2 ];
378
+ }
379
+ elseif (!in_array ($ fields [1 ], $ usedProperties , true )) {
376
380
continue ;
377
381
}
382
+ else {
383
+ $ property = $ fields [1 ];
384
+ }
385
+
378
386
379
387
$ range = explode ('.. ' , $ fields [0 ]);
380
388
if (count ($ range ) == 2 ) {
You can’t perform that action at this time.
0 commit comments