Lines Matching refs:pos
317 static inline int32_t posBefore(const Replaceable& str, int32_t pos) {
318 return (pos > 0) ?
319 pos - U16_LENGTH(str.char32At(pos-1)) :
320 pos - 1;
323 static inline int32_t posAfter(const Replaceable& str, int32_t pos) {
324 return (pos >= 0 && pos < str.length()) ?
325 pos + U16_LENGTH(str.char32At(pos)) :
326 pos + 1;
339 * If a full match is obtained, perform a replacement, update pos,
340 * and return U_MATCH. Otherwise both text and pos are unchanged.
343 * @param pos the position indices
345 * be completed by additional text inserted at pos.limit.
351 UTransPosition& pos,
385 int32_t anteLimit = posBefore(text, pos.contextStart);
389 // Start reverse match at char before pos.start
390 oText = posBefore(text, pos.start);
409 oText = pos.start;
412 match = key->matches(text, oText, pos.limit, incremental);
421 if (incremental && keyLimit == pos.limit) {
422 // The key matches just before pos.limit, and there is
425 // pos.limit -- this is a partial match.
429 match = postContext->matches(text, oText, pos.contextLimit, incremental);
438 if (oText != pos.contextLimit) {
448 // We have a full match. The key is between pos.start and
452 int32_t newLength = output->toReplacer()->replace(text, pos.start, keyLimit, newStart);
453 int32_t lenDelta = newLength - (keyLimit - pos.start);
456 pos.limit += lenDelta;
457 pos.contextLimit += lenDelta;
458 // Restrict new value of start to [minOText, min(oText, pos.limit)].
459 pos.start = uprv_max(minOText, uprv_min(uprv_min(oText, pos