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

Method CheckNonUniformCharBefore

LuaParser/src/File/LuaSource.cpp:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61
62
63bool LuaSource::CheckNonUniformCharBefore(std::size_t offset) const {
64 auto line = GetLine(offset);
65 auto lineStartOffset = _lineOffsetVec[line];
66
67 if (offset > lineStartOffset) {
68 std::size_t byteNum = 0;
69 for (std::size_t i = lineStartOffset; i < offset; i += byteNum) {
70 auto codepoint = utf8::Utf8ToUnicode(_source.data() + i, _source.size() - i, byteNum);
71 // support UTF-8 Latin B
72 if (codepoint > 0x24F) {
73 return true;
74 }
75 }
76 }
77 return false;
78}
79
80std::size_t LuaSource::GetLineOffset(std::size_t offset) const {
81 auto line = GetLine(offset);

Callers 2

ResolveAlignGroupMethod · 0.80

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected