@@ -369,6 +369,14 @@ template <> struct ScalarEnumerationTraits<FormatStyle::JavaScriptQuoteStyle> {
369369 }
370370};
371371
372+ template <> struct MappingTraits <FormatStyle::KeepEmptyLinesStyle> {
373+ static void mapping (IO &IO, FormatStyle::KeepEmptyLinesStyle &Value) {
374+ IO.mapOptional (" AtEndOfFile" , Value.AtEndOfFile );
375+ IO.mapOptional (" AtStartOfBlock" , Value.AtStartOfBlock );
376+ IO.mapOptional (" AtStartOfFile" , Value.AtStartOfFile );
377+ }
378+ };
379+
372380template <> struct ScalarEnumerationTraits <FormatStyle::LanguageKind> {
373381 static void enumeration (IO &IO, FormatStyle::LanguageKind &Value) {
374382 IO.enumCase (Value, " Cpp" , FormatStyle::LK_Cpp);
@@ -869,6 +877,9 @@ template <> struct MappingTraits<FormatStyle> {
869877 OnCurrentLine);
870878 IO.mapOptional (" DeriveLineEnding" , DeriveLineEnding);
871879 IO.mapOptional (" DerivePointerBinding" , Style.DerivePointerAlignment );
880+ IO.mapOptional (" KeepEmptyLinesAtEOF" , Style.KeepEmptyLines .AtEndOfFile );
881+ IO.mapOptional (" KeepEmptyLinesAtTheStartOfBlocks" ,
882+ Style.KeepEmptyLines .AtStartOfBlock );
872883 IO.mapOptional (" IndentFunctionDeclarationAfterType" ,
873884 Style.IndentWrappedFunctionNames );
874885 IO.mapOptional (" IndentRequires" , Style.IndentRequiresClause );
@@ -1004,9 +1015,7 @@ template <> struct MappingTraits<FormatStyle> {
10041015 IO.mapOptional (" JavaImportGroups" , Style.JavaImportGroups );
10051016 IO.mapOptional (" JavaScriptQuotes" , Style.JavaScriptQuotes );
10061017 IO.mapOptional (" JavaScriptWrapImports" , Style.JavaScriptWrapImports );
1007- IO.mapOptional (" KeepEmptyLinesAtTheStartOfBlocks" ,
1008- Style.KeepEmptyLinesAtTheStartOfBlocks );
1009- IO.mapOptional (" KeepEmptyLinesAtEOF" , Style.KeepEmptyLinesAtEOF );
1018+ IO.mapOptional (" KeepEmptyLines" , Style.KeepEmptyLines );
10101019 IO.mapOptional (" LambdaBodyIndentation" , Style.LambdaBodyIndentation );
10111020 IO.mapOptional (" LineEnding" , Style.LineEnding );
10121021 IO.mapOptional (" MacroBlockBegin" , Style.MacroBlockBegin );
@@ -1517,8 +1526,11 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
15171526 /* Hex=*/ 0 , /* HexMinDigits=*/ 0 };
15181527 LLVMStyle.JavaScriptQuotes = FormatStyle::JSQS_Leave;
15191528 LLVMStyle.JavaScriptWrapImports = true ;
1520- LLVMStyle.KeepEmptyLinesAtEOF = false ;
1521- LLVMStyle.KeepEmptyLinesAtTheStartOfBlocks = true ;
1529+ LLVMStyle.KeepEmptyLines = {
1530+ /* AtEndOfFile=*/ false ,
1531+ /* AtStartOfBlock=*/ true ,
1532+ /* AtStartOfFile=*/ true ,
1533+ };
15221534 LLVMStyle.LambdaBodyIndentation = FormatStyle::LBI_Signature;
15231535 LLVMStyle.Language = Language;
15241536 LLVMStyle.LineEnding = FormatStyle::LE_DeriveLF;
@@ -1641,7 +1653,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
16411653 {" .*" , 3 , 0 , false }};
16421654 GoogleStyle.IncludeStyle .IncludeIsMainRegex = " ([-_](test|unittest))?$" ;
16431655 GoogleStyle.IndentCaseLabels = true ;
1644- GoogleStyle.KeepEmptyLinesAtTheStartOfBlocks = false ;
1656+ GoogleStyle.KeepEmptyLines . AtStartOfBlock = false ;
16451657 GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never;
16461658 GoogleStyle.ObjCSpaceAfterProperty = false ;
16471659 GoogleStyle.ObjCSpaceBeforeProtocolList = true ;
0 commit comments