Lines Matching refs:code
135 public function addProp(int $code, string $prop) { argument
142 if ($code === $lastRange->end + 1) {
148 $this->propRanges[$propIdx][] = new Range($code, $code);
223 $code = intval($fields[0], 16);
237 $data->addPropRange($code, $nextCode, $generalCategory);
240 $data->addPropRange($code, $nextCode, $bidiClass);
245 $data->addProp($code, $generalCategory);
248 $data->addProp($code, $bidiClass);
254 $data->addCaseMapping('upper', $code, $upperCase);
257 $data->addCaseMapping('lower', $code, $lowerCase);
260 $data->addCaseMapping('title', $code, $titleCase);
279 $code = intval($fields[0], 16);
288 if (!isset($data->caseMaps['fold'][$code])) {
289 $data->addCaseMapping('fold', $code, $foldCode);
292 assert(is_array($data->caseMaps['fold'][$code]));
293 $data->caseMaps['fold'][$code][0] = $foldCode;
297 $existingFoldCode = $data->caseMaps['fold'][$code] ?? $code;
298 $data->caseMaps['fold'][$code] = array_merge([$code], $foldCodes);
305 function addSpecialCasing(UnicodeData $data, string $type, int $code, array $caseCodes) : void { argument
306 $simpleCaseCode = $data->caseMaps[$type][$code] ?? $code;
314 if ($type == 'title' && $code == $caseCodes[0]
315 && ($data->caseMaps['upper'][$code] ?? $code) != $code) {
316 $data->caseMaps['title'][$code] = $code;
325 $data->caseMaps[$type][$code] = array_merge([$simpleCaseCode], $caseCodes);
334 $code = intval($fields[0], 16);
345 addSpecialCasing($data, 'lower', $code, $lower);
346 addSpecialCasing($data, 'upper', $code, $upper);
349 addSpecialCasing($data, 'title', $code, $title);
455 foreach ($data->caseMaps['title'] as $code => $titleCode) {
456 if ($titleCode == ($data->caseMaps['upper'][$code] ?? $code)) {
457 unset($data->caseMaps['title'][$code]);
464 foreach ($caseMap as $code => $caseCode) {
469 $data->caseMaps[$type][$code] = ($len << 24) | $idx;