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

Method visitChunk

src/FormatVisitor.cpp:276–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276antlrcpp::Any FormatVisitor::visitChunk(LuaParser::ChunkContext* ctx) {
277 LOG_FUNCTION_BEGIN();
278 pushWriter();
279 cur_writer() << commentAfter(nullptr, "");
280 bool temp = chop_down_block_;
281 chop_down_block_ = true;
282 visitBlock(ctx->block());
283 chop_down_block_ = temp;
284 std::string comment = commentAfterNewLine(ctx->block(), NONE_INDENT);
285
286 cur_writer() << comment;
287 std::string ret = cur_writer().str();
288 if (*ret.rbegin() != '\n') {
289 ret += '\n';
290 }
291 popWriter();
292 LOG_FUNCTION_END();
293 return ret;
294}
295
296// stat* retstat?
297antlrcpp::Any FormatVisitor::visitBlock(LuaParser::BlockContext* ctx) {

Callers

nothing calls this directly

Calls 2

blockMethod · 0.80
strMethod · 0.80

Tested by

no test coverage detected