MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / ReadLongString

Method ReadLongString

LuaParser/src/Lexer/LuaLexer.cpp:483–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483void LuaLexer::ReadLongString(std::size_t sep) {
484 _reader.SaveAndNext();
485
486 if (CurrentIsNewLine()) {
487 IncLinenumber();
488 }
489
490 for (;;) {
491 switch (_reader.GetCurrentChar()) {
492 case EOZ: {
493 TokenError("unfinished long string starting", TextRange(_reader.GetPos(), 0));
494 return;
495 }
496 case ']': {
497 if (SkipSep() == sep) {
498 _reader.SaveAndNext();
499 return;
500 }
501 break;
502 }
503 case '\n':
504 case '\r': {
505 _reader.Save();
506 IncLinenumber();
507 break;
508 }
509 default: {
510 _reader.SaveAndNext();
511 }
512 }
513 }
514}
515
516void LuaLexer::ReadLongCLikeComment() {
517 if (CurrentIsNewLine()) {

Callers

nothing calls this directly

Calls 5

TextRangeClass · 0.85
SaveAndNextMethod · 0.80
GetCurrentCharMethod · 0.80
GetPosMethod · 0.80
SaveMethod · 0.80

Tested by

no test coverage detected