@@ -382,6 +382,7 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatAssignment(std::shared_ptr<Lu
382382 env->Add <KeepBlankElement>(1 );
383383 isLeftExprList = false ;
384384 }
385+
385386 break ;
386387 }
387388 default :
@@ -461,6 +462,36 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatExpressionList(std::shared_pt
461462 return env;
462463}
463464
465+ std::shared_ptr<FormatElement> LuaFormatter::FormatAssignLeftExpressionList (std::shared_ptr<LuaAstNode> expressionList)
466+ {
467+ auto env = std::make_shared<LongExpressionLayoutElement>(_options.continuation_indent , true );
468+
469+ for (auto node : expressionList->GetChildren ())
470+ {
471+ switch (node->GetType ())
472+ {
473+ case LuaAstNodeType::Expression:
474+ {
475+ auto subEnv = std::make_shared<SubExpressionElement>();
476+ env->AddChild (FormatExpression (node, subEnv));
477+ env->Add <KeepElement>(0 );
478+ break ;
479+ }
480+ case LuaAstNodeType::GeneralOperator:
481+ {
482+ env->Add <TextElement>(node);
483+ env->Add <KeepElement>(1 );
484+ break ;
485+ }
486+ default :
487+ DefaultHandle (node, env);
488+ env->Add <KeepElement>(1 );
489+ }
490+ }
491+
492+ return env;
493+ }
494+
464495std::shared_ptr<FormatElement> LuaFormatter::FormatComment (std::shared_ptr<LuaAstNode> comment)
465496{
466497 auto env = std::make_shared<ExpressionElement>();
@@ -910,6 +941,10 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatCallArgList(std::shared_ptr<L
910941 }
911942 else
912943 {
944+ auto & exprListChildren = exprListEnv->GetChildren ();
945+ auto keepElement = std::make_shared<KeepElement>(0 );
946+ exprListChildren.insert (exprListChildren.begin (), keepElement);
947+
913948 env->AddChild (exprListEnv);
914949 }
915950
@@ -1444,8 +1479,8 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatNodeAndBlockOrEnd(int& curren
14441479 {
14451480 env->Add <KeepBlankElement>(1 );
14461481 env->Add <TextElement>(comment);
1482+ currentIndex++;
14471483 }
1448- currentIndex++;
14491484 }
14501485
14511486 bool blockExist = false ;
0 commit comments