diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2024-10-08 17:05:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-10-23 18:27:28 +0000 |
commit | 6e516c87b6d779911edde7481d8aef165b837a03 (patch) | |
tree | ae229b5c223ad999622eb6ac39c860428007f3bb /contrib/llvm-project/clang/lib/Format/FormatTokenLexer.cpp | |
parent | c80e69b00d976a5a3b3e84527f270fa7e72a8205 (diff) | |
parent | 0370629593a68f2e04a9710d201d120a2ce437d4 (diff) |
Diffstat (limited to 'contrib/llvm-project/clang/lib/Format/FormatTokenLexer.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/Format/FormatTokenLexer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/llvm-project/clang/lib/Format/FormatTokenLexer.cpp b/contrib/llvm-project/clang/lib/Format/FormatTokenLexer.cpp index e21b5a882b77..63949b2e26bd 100644 --- a/contrib/llvm-project/clang/lib/Format/FormatTokenLexer.cpp +++ b/contrib/llvm-project/clang/lib/Format/FormatTokenLexer.cpp @@ -100,6 +100,13 @@ ArrayRef<FormatToken *> FormatTokenLexer::lex() { if (Tokens.back()->NewlinesBefore > 0 || Tokens.back()->IsMultiline) FirstInLineIndex = Tokens.size() - 1; } while (Tokens.back()->isNot(tok::eof)); + if (Style.InsertNewlineAtEOF) { + auto &TokEOF = *Tokens.back(); + if (TokEOF.NewlinesBefore == 0) { + TokEOF.NewlinesBefore = 1; + TokEOF.OriginalColumn = 0; + } + } return Tokens; } |