MCPcopy Create free account
hub / github.com/crownengine/crown / findIdentifierMatch

Function findIdentifierMatch

3rdparty/bx/src/string.cpp:689–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687 }
688
689 StringView findIdentifierMatch(const StringView& _str, const StringView& _word)
690 {
691 const int32_t len = _word.getLength();
692 StringView ptr = strFind(_str, _word);
693 for (; !ptr.isEmpty(); ptr = strFind(StringView(ptr.getPtr() + len, _str.getTerm() ), _word) )
694 {
695 char ch = ptr.getPtr() != _str.getPtr() ? *(ptr.getPtr() - 1) : ' ';
696 if (isAlphaNum(ch) || '_' == ch)
697 {
698 continue;
699 }
700
701 ch = *(ptr.getPtr() + len);
702 if (isAlphaNum(ch) || '_' == ch)
703 {
704 continue;
705 }
706
707 return ptr;
708 }
709
710 return StringView(_str.getTerm(), _str.getTerm() );
711 }
712
713 StringView findIdentifierMatch(const StringView& _str, const char** _words, int32_t _num)
714 {

Callers 6

compileFunction · 0.85
compileFunction · 0.85
compileShaderFunction · 0.85
compileFunction · 0.85
createMethod · 0.85
createMethod · 0.85

Calls 4

strFindFunction · 0.85
isAlphaNumFunction · 0.85
StringViewClass · 0.50
isEmptyMethod · 0.45

Tested by

no test coverage detected