MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / readutf8esc

Function readutf8esc

extlibs/lua/src/llex.c:340–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

utf8escFunction · 0.85

Calls 3

esccheckFunction · 0.85
gethexaFunction · 0.85
luaO_hexavalueFunction · 0.85

Tested by

no test coverage detected