MCPcopy Create free account
hub / github.com/Koihik/LuaFormatter / formatLineComment

Method formatLineComment

src/FormatVisitor.cpp:265–274  ·  view source on GitHub ↗

Add a white space before line comment

Source from the content-addressed store, hash-verified

263
264// Add a white space before line comment
265std::string FormatVisitor::formatLineComment(Token* token) {
266 std::string comment = token->getText();
267 char firstChar = comment[2];
268 if (isBlankChar(firstChar) || firstChar == '-' || firstChar == '\r' || firstChar == '\n') {
269 // do nothing
270 } else {
271 comment = "-- " + comment.substr(2, comment.size());
272 }
273 return comment;
274}
275
276antlrcpp::Any FormatVisitor::visitChunk(LuaParser::ChunkContext* ctx) {
277 LOG_FUNCTION_BEGIN();

Callers

nothing calls this directly

Calls 1

isBlankCharFunction · 0.85

Tested by

no test coverage detected