| 592 | |
| 593 | |
| 594 | void LuaLexer::IncLinenumber() { |
| 595 | int old = _reader.GetCurrentChar(); |
| 596 | |
| 597 | _reader.NextChar(); |
| 598 | |
| 599 | if (CurrentIsNewLine() && _reader.GetCurrentChar() != old) { |
| 600 | _reader.NextChar(); /* skip '\n\r' or '\r\n' */ |
| 601 | _file->SetEndOfLineState(EndOfLine::CRLF); |
| 602 | } else if (old == '\n') { |
| 603 | _file->SetEndOfLineState(EndOfLine::LF); |
| 604 | } else { |
| 605 | _file->SetEndOfLineState(EndOfLine::CR); |
| 606 | } |
| 607 | |
| 608 | if (++_linenumber >= std::numeric_limits<int>::max()) { |
| 609 | return; |
| 610 | } |
| 611 | |
| 612 | _file->PushLine(_reader.GetPos()); |
| 613 | } |
| 614 | |
| 615 | bool LuaLexer::CurrentIsNewLine() { |
| 616 | int ch = _reader.GetCurrentChar(); |
nothing calls this directly
no test coverage detected