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

Method visitVarlist

src/FormatVisitor.cpp:657–674  ·  view source on GitHub ↗

var (COMMA var)*;

Source from the content-addressed store, hash-verified

655
656// var (COMMA var)*;
657antlrcpp::Any FormatVisitor::visitVarlist(LuaParser::VarlistContext* ctx) {
658 LOG_FUNCTION_BEGIN();
659 visitVar(ctx->var().front());
660 int n = ctx->COMMA().size();
661 if (n > 0) {
662 cur_writer() << commentAfter(ctx->var().front(), "");
663 }
664 for (int i = 0; i < n; i++) {
665 cur_writer() << ctx->COMMA()[i]->getText();
666 cur_writer() << commentAfter(ctx->COMMA()[i], " ");
667 visitVar(ctx->var()[i + 1]);
668 if (i != n - 1) {
669 cur_writer() << commentAfter(ctx->var()[i + 1], "");
670 }
671 }
672 LOG_FUNCTION_END();
673 return nullptr;
674}
675
676// NAME (COMMA NAME)*;
677antlrcpp::Any FormatVisitor::visitNamelist(LuaParser::NamelistContext* ctx) {

Callers

nothing calls this directly

Calls 2

varMethod · 0.80
COMMAMethod · 0.80

Tested by

no test coverage detected