MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / FindTextDelim

Function FindTextDelim

source/util.cpp:2935–2959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2933
2934
2935int FindTextDelim(LPCTSTR aBuf, TCHAR aDelimiter, int aStartIndex, LPCTSTR aLiteralMap)
2936{
2937 for (int mark = aStartIndex; ; ++mark)
2938 {
2939 if (aBuf[mark] == aDelimiter)
2940 {
2941 if (aLiteralMap && aLiteralMap[mark])
2942 continue;
2943 return mark;
2944 }
2945 switch (aBuf[mark])
2946 {
2947 case '\0':
2948 // Reached the end of the string without finding a delimiter. Return the
2949 // index of the null-terminator since that's typically what the caller wants.
2950 return mark;
2951 case '`':
2952 // This allows g_DerefChar or aDelimiter to be escaped, but since every other non-null
2953 // character has no meaning here, it doesn't need to check which character it is skipping.
2954 if (!aLiteralMap && aBuf[mark+1])
2955 ++mark;
2956 continue;
2957 }
2958 }
2959}
2960
2961
2962

Callers 5

GetLineContinuationMethod · 0.85
ParseAndAddLineMethod · 0.85
ParseOperandsMethod · 0.85
FindExprDelimFunction · 0.85
BalanceExprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected