| 330 | } |
| 331 | |
| 332 | void 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++; |
nothing calls this directly
no test coverage detected