MCPcopy Create free account
hub / github.com/catboost/catboost / GetRightTokenDelim

Function GetRightTokenDelim

library/cpp/token/token_structure.h:272–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272inline wchar16 GetRightTokenDelim(const TWideToken& tok, size_t index) {
273 const TTokenStructure& subtokens = tok.SubTokens;
274 Y_ASSERT(index < subtokens.size());
275 if (index + 1 >= subtokens.size())
276 return 0;
277 const TCharSpan& subtok = subtokens[index];
278 const size_t delimPos = subtok.EndPos() + subtok.SuffixLen;
279 const TCharSpan& next = subtokens[index + 1];
280 return (delimPos == next.Pos - next.PrefixLen ? 0 : tok.Token[delimPos]);
281}
282
283//! @note yc_minus (0x2D) can be 0xB7 that is an ASCII character as well
284inline char GetTokenDelimChar(ETokenDelim delim) {

Callers

nothing calls this directly

Calls 2

EndPosMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected