MCPcopy Create free account
hub / github.com/DFHack/dfhack / skip_sep

Function skip_sep

depends/lua/src/llex.c:251–264  ·  view source on GitHub ↗

** reads a sequence '[=*[' or ']=*]', leaving the last bracket. ** If sequence is well formed, return its number of '='s + 2; otherwise, ** return 1 if there is no '='s or 0 otherwise (an unfinished '[==...'). */

Source from the content-addressed store, hash-verified

249** return 1 if there is no '='s or 0 otherwise (an unfinished '[==...').
250*/
251static size_t skip_sep (LexState *ls) {
252 size_t count = 0;
253 int s = ls->current;
254 lua_assert(s == '[' || s == ']');
255 save_and_next(ls);
256 while (ls->current == '=') {
257 save_and_next(ls);
258 count++;
259 }
260 return (ls->current == s) ? count + 2
261 : (count == 0) ? 1
262 : 0;
263
264}
265
266
267static void read_long_string (LexState *ls, SemInfo *seminfo, size_t sep) {

Callers 2

read_long_stringFunction · 0.85
llexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected