MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxAdvanceStringIndex

Function fxAdvanceStringIndex

xs/sources/xsRegExp.c:101–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100#if mxRegExp
101txNumber fxAdvanceStringIndex(txMachine* the, txString string, txNumber index, txBoolean unicodeFlag)
102{
103#if mxCESU8
104 if (unicodeFlag) {
105 txInteger character;
106 txSize offset = fxCacheUnicodeLength(the, string);
107 if (index >= offset)
108 return index + 1;
109 offset = fxCacheUnicodeToUTF8Offset(the, string, (txInteger)index);
110 offset = mxPtrDiff(mxStringByteDecode(string + offset, &character) - string);
111 if (character == C_EOF)
112 return index + 1;
113 return fxCacheUTF8ToUnicodeOffset(the, string, offset);
114 }
115#endif
116 return index + 1;
117}
118
119txSlot* fxCheckRegExpInstance(txMachine* the, txSlot* slot)
120{

Calls 3

fxCacheUnicodeLengthFunction · 0.85

Tested by

no test coverage detected