Lines Matching refs:code
128 public function addProp(int $code, string $prop) { argument
135 if ($code === $lastRange->end + 1) {
141 $this->propRanges[$propIdx][] = new Range($code, $code);
216 $code = intval($fields[0], 16);
230 $data->addPropRange($code, $nextCode, $generalCategory);
233 $data->addPropRange($code, $nextCode, $bidiClass);
238 $data->addProp($code, $generalCategory);
241 $data->addProp($code, $bidiClass);
247 $data->addCaseMapping('upper', $code, $upperCase);
250 $data->addCaseMapping('lower', $code, $lowerCase);
253 $data->addCaseMapping('title', $code, $titleCase);
272 $code = intval($fields[0], 16);
281 if (!isset($data->caseMaps['fold'][$code])) {
282 $data->addCaseMapping('fold', $code, $foldCode);
285 assert(is_array($data->caseMaps['fold'][$code]));
286 $data->caseMaps['fold'][$code][0] = $foldCode;
290 $existingFoldCode = $data->caseMaps['fold'][$code] ?? $code;
291 $data->caseMaps['fold'][$code] = array_merge([$code], $foldCodes);
298 function addSpecialCasing(UnicodeData $data, string $type, int $code, array $caseCodes) : void { argument
299 $simpleCaseCode = $data->caseMaps[$type][$code] ?? $code;
307 if ($type == 'title' && $code == $caseCodes[0]
308 && ($data->caseMaps['upper'][$code] ?? $code) != $code) {
309 $data->caseMaps['title'][$code] = $code;
318 $data->caseMaps[$type][$code] = array_merge([$simpleCaseCode], $caseCodes);
327 $code = intval($fields[0], 16);
338 addSpecialCasing($data, 'lower', $code, $lower);
339 addSpecialCasing($data, 'upper', $code, $upper);
342 addSpecialCasing($data, 'title', $code, $title);
448 foreach ($data->caseMaps['title'] as $code => $titleCode) {
449 if ($titleCode == ($data->caseMaps['upper'][$code] ?? $code)) {
450 unset($data->caseMaps['title'][$code]);
457 foreach ($caseMap as $code => $caseCode) {
462 $data->caseMaps[$type][$code] = ($len << 24) | $idx;