MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / readutf8esc

Function readutf8esc

3rd/lua-5.4.3/src/llex.c:343–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341
342
343static unsigned long readutf8esc (LexState *ls) {
344 unsigned long r;
345 int i = 4; /* chars to be removed: '\', 'u', '{', and first digit */
346 save_and_next(ls); /* skip 'u' */
347 esccheck(ls, ls->current == '{', "missing '{'");
348 r = gethexa(ls); /* must have at least one digit */
349 while (cast_void(save_and_next(ls)), lisxdigit(ls->current)) {
350 i++;
351 esccheck(ls, r <= (0x7FFFFFFFu >> 4), "UTF-8 value too large");
352 r = (r << 4) + luaO_hexavalue(ls->current);
353 }
354 esccheck(ls, ls->current == '}', "missing '}'");
355 next(ls); /* skip '}' */
356 luaZ_buffremove(ls->buff, i); /* remove saved chars from buffer */
357 return r;
358}
359
360
361static void utf8esc (LexState *ls) {

Callers 1

utf8escFunction · 0.85

Calls 4

esccheckFunction · 0.85
gethexaFunction · 0.85
luaO_hexavalueFunction · 0.85
nextFunction · 0.85

Tested by

no test coverage detected