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

Method visitLocalVarDecl

src/FormatVisitor.cpp:615–636  ·  view source on GitHub ↗

LOCAL namelist (EQL explist)? SEMI?;

Source from the content-addressed store, hash-verified

613
614// LOCAL namelist (EQL explist)? SEMI?;
615antlrcpp::Any FormatVisitor::visitLocalVarDecl(LuaParser::LocalVarDeclContext* ctx) {
616 LOG_FUNCTION_BEGIN();
617 cur_writer() << ctx->LOCAL()->getText();
618 cur_writer() << commentAfter(ctx->LOCAL(), " ");
619 visitAttnamelist(ctx->attnamelist());
620 if (ctx->EQL() != nullptr) {
621 cur_writer() << commentAfter(ctx->attnamelist(), " ");
622 cur_writer() << ctx->EQL()->getText();
623 cur_writer() << commentAfter(ctx->EQL(), " ");
624 visitExplist(ctx->explist());
625 }
626 if (ctx->SEMI() != nullptr) {
627 if (ctx->EQL() == nullptr) {
628 cur_writer() << commentAfter(ctx->attnamelist(), "");
629 } else {
630 cur_writer() << commentAfter(ctx->explist(), "");
631 }
632 cur_writer() << ctx->SEMI()->getText();
633 }
634 LOG_FUNCTION_END();
635 return nullptr;
636}
637
638// RETURN explist? SEMI?;
639antlrcpp::Any FormatVisitor::visitRetstat(LuaParser::RetstatContext* ctx) {

Callers

nothing calls this directly

Calls 5

LOCALMethod · 0.80
attnamelistMethod · 0.80
EQLMethod · 0.80
explistMethod · 0.80
SEMIMethod · 0.80

Tested by

no test coverage detected