MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / _advance

Method _advance

bytecode/gdscript_v1_tokenizer_compat.cpp:332–964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void GDScriptV1TokenizerTextCompat::_advance() {
333 if (error_flag) {
334 //parser broke
335 _make_error(last_error);
336 return;
337 }
338
339 if (code_pos >= len) {
340 _make_token(T::G_TK_EOF);
341 return;
342 }
343#define GETCHAR(m_ofs) ((m_ofs + code_pos) >= len ? 0 : _code[m_ofs + code_pos])
344#define INCPOS(m_amount) \
345 { \
346 code_pos += m_amount; \
347 column += m_amount; \
348 }
349 while (true) {
350 bool is_node_path = false;
351 StringMode string_mode = STRING_DOUBLE_QUOTE;
352
353 switch (GETCHAR(0)) {
354 case 0:
355 _make_token(T::G_TK_EOF);
356 break;
357 case '\\':
358 INCPOS(1);
359 if (GETCHAR(0) == '\r') {
360 INCPOS(1);
361 }
362
363 if (GETCHAR(0) != '\n') {
364 _make_error("Expected newline after '\\'.");
365 return;
366 }
367
368 INCPOS(1);
369 line++;
370
371 while (GETCHAR(0) == ' ' || GETCHAR(0) == '\t') {
372 INCPOS(1);
373 }
374
375 continue;
376 case '\t':
377 case '\r':
378 case ' ':
379 INCPOS(1);
380 continue;
381 case '#': { // line comment skip
382#ifdef DEBUG_ENABLED
383 String comment;
384#endif // DEBUG_ENABLED
385 while (GETCHAR(0) != '\n') {
386#ifdef DEBUG_ENABLED
387 comment += GETCHAR(0);
388#endif // DEBUG_ENABLED
389 code_pos++;

Callers

nothing calls this directly

Calls 10

_is_numberFunction · 0.85
_is_hexFunction · 0.85
_is_binFunction · 0.85
_is_text_charFunction · 0.85
push_backMethod · 0.80
lengthMethod · 0.80
insertMethod · 0.45
get_local_token_valMethod · 0.45
get_variant_ver_majorMethod · 0.45
get_function_indexMethod · 0.45

Tested by

no test coverage detected