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

Method IsNewLine

CodeFormatCore/src/Format/FormatState.cpp:40–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40bool FormatState::IsNewLine(LuaSyntaxNode &n, const LuaSyntaxTree &t) const {
41 if (_mode == Mode::Format) {
42 return _currentWidth == 0;
43 } else {
44 auto prev = n.GetPrevToken(t);
45 return prev.IsNull(t) || n.GetPrevToken(t).GetEndLine(t) != n.GetStartLine(t);
46 }
47}
48
49void FormatState::Analyze(const LuaSyntaxTree &t) {
50 AddAnalyzer<SpaceAnalyzer>();

Callers 4

BasicResolveMethod · 0.80
DoResolveMethod · 0.80
ResolveAlignGroupMethod · 0.80
QueryMethod · 0.80

Calls 4

GetEndLineMethod · 0.80
GetStartLineMethod · 0.80
GetPrevTokenMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected