| 545 | } |
| 546 | |
| 547 | void LuaLexer::ReadString(int del) { |
| 548 | _reader.SaveAndNext(); |
| 549 | while (_reader.GetCurrentChar() != del) { |
| 550 | switch (_reader.GetCurrentChar()) { |
| 551 | case EOZ: |
| 552 | case '\n': |
| 553 | case '\r': { |
| 554 | TokenError("unfinished string", TextRange(_reader.GetPos(), 0)); |
| 555 | return; |
| 556 | } |
| 557 | case '\\': { |
| 558 | _reader.SaveAndNext(); |
| 559 | |
| 560 | switch (_reader.GetCurrentChar()) { |
| 561 | case EOZ: |
| 562 | TokenError("unfinished string", TextRange(_reader.GetPos(), 0)); |
| 563 | return; |
| 564 | case 'z': { |
| 565 | _reader.SaveAndNext(); |
| 566 | while (lisspace(_reader.GetCurrentChar())) { |
| 567 | if (CurrentIsNewLine()) { |
| 568 | IncLinenumber(); |
| 569 | } else { |
| 570 | _reader.SaveAndNext(); |
| 571 | } |
| 572 | } |
| 573 | goto no_save; |
| 574 | } |
| 575 | case '\r': |
| 576 | case '\n': { |
| 577 | if (CurrentIsNewLine()) { |
| 578 | IncLinenumber(); |
| 579 | } |
| 580 | goto no_save; |
| 581 | } |
| 582 | } |
| 583 | break; |
| 584 | } |
| 585 | } |
| 586 | _reader.SaveAndNext(); |
| 587 | // 空语句 |
| 588 | no_save:; |
| 589 | } |
| 590 | _reader.SaveAndNext(); |
| 591 | } |
| 592 | |
| 593 | |
| 594 | void LuaLexer::IncLinenumber() { |
nothing calls this directly
no test coverage detected