diff options
author | zhvv117 <[email protected]> | 2025-01-31 12:58:25 +0300 |
---|---|---|
committer | zhvv117 <[email protected]> | 2025-01-31 13:24:51 +0300 |
commit | 757ce306e6a07bfb3a3c4d729c75cd7512af2e45 (patch) | |
tree | cc372ebce924cddb5da846cb9e8a2d48a8b45223 /yql/essentials/sql/v1/format/sql_format.cpp | |
parent | f12d0f878911d1506ff75f19bb550d498b9ec242 (diff) |
Fix comment line count calculation
commit_hash:b18a35e909cfd6662088765125b0d6f3dcf83c15
Diffstat (limited to 'yql/essentials/sql/v1/format/sql_format.cpp')
-rw-r--r-- | yql/essentials/sql/v1/format/sql_format.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/yql/essentials/sql/v1/format/sql_format.cpp b/yql/essentials/sql/v1/format/sql_format.cpp index 3b180827a65..19619bf6e89 100644 --- a/yql/essentials/sql/v1/format/sql_format.cpp +++ b/yql/essentials/sql/v1/format/sql_format.cpp @@ -496,6 +496,10 @@ private: ++CommentLines; } + if (!text.StartsWith("--")) { + CommentLines += CountIf(text, [](auto c) { return c == '\n'; }); + } + Out(text); if (text.StartsWith("--") && !text.EndsWith("\n")) { |