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

Method SkipSep

LuaParser/src/Lexer/LuaLexer.cpp:466–481  ·  view source on GitHub ↗

** read a sequence '[=*[' or ']=*]', leaving the last bracket. If ** sequence is well formed, return its number of '='s + 2; otherwise, ** return 1 if it is a single bracket (no '='s and no 2nd bracket); ** otherwise (an unfinished '[==...') return 0. */

Source from the content-addressed store, hash-verified

464** otherwise (an unfinished '[==...') return 0.
465*/
466std::size_t LuaLexer::SkipSep() {
467 std::size_t count = 0;
468 int ch = _reader.GetCurrentChar();
469
470 _reader.SaveAndNext();
471
472 while (_reader.GetCurrentChar() == '=') {
473 _reader.SaveAndNext();
474 count++;
475 }
476
477 return _reader.GetCurrentChar() == ch
478 ? count + 2
479 : (count == 0) ? 1
480 : 0;
481}
482
483void LuaLexer::ReadLongString(std::size_t sep) {
484 _reader.SaveAndNext();

Callers

nothing calls this directly

Calls 2

GetCurrentCharMethod · 0.80
SaveAndNextMethod · 0.80

Tested by

no test coverage detected