MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / readutf8esc

Function readutf8esc

src/Chain/libraries/glua/llex.cpp:361–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359
360
361static unsigned long readutf8esc(LexState *ls) {
362 unsigned long r;
363 int i = 4; /* chars to be removed: '\', 'u', '{', and first digit */
364 save_and_next(ls); /* skip 'u' */
365 esccheck(ls, ls->current == '{', "missing '{'");
366 r = gethexa(ls); /* must have at least one digit */
367 while ((save_and_next(ls), lisxdigit(ls->current))) {
368 i++;
369 r = (r << 4) + luaO_hexavalue(ls->current);
370 esccheck(ls, r <= 0x10FFFF, "UTF-8 value too large");
371 }
372 esccheck(ls, ls->current == '}', "missing '}'");
373 next(ls); /* skip '}' */
374 luaZ_buffremove(ls->buff, i); /* remove saved chars from buffer */
375 return r;
376}
377
378
379static void utf8esc(LexState *ls) {

Callers 1

utf8escFunction · 0.85

Calls 4

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

Tested by

no test coverage detected