summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/format/sql_format.cpp
diff options
context:
space:
mode:
authorzhvv117 <[email protected]>2024-12-19 12:11:49 +0300
committerzhvv117 <[email protected]>2024-12-19 13:07:06 +0300
commit72e5d59e4685dd66c0ecb0f845a3871e3e3d2a40 (patch)
tree606292083f3622ca6f9b00dbcde06f2b417673b4 /yql/essentials/sql/v1/format/sql_format.cpp
parent00dc4e62afc0e824eb511d411ac8de90e11e46da (diff)
do not add newline before comment if it is on the same line with statement
commit_hash:9a54a67e4d5d56469392ff71aa9585650b1e78a3
Diffstat (limited to 'yql/essentials/sql/v1/format/sql_format.cpp')
-rw-r--r--yql/essentials/sql/v1/format/sql_format.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/yql/essentials/sql/v1/format/sql_format.cpp b/yql/essentials/sql/v1/format/sql_format.cpp
index b330800734b..b7a8d5c48de 100644
--- a/yql/essentials/sql/v1/format/sql_format.cpp
+++ b/yql/essentials/sql/v1/format/sql_format.cpp
@@ -276,6 +276,11 @@ TTokenIterator GetNextStatementBegin(TTokenIterator begin, TTokenIterator end) {
continue;
}
if (curr->Name == "SEMICOLON") {
+ auto next = SkipWS(curr + 1, end);
+ while (next != end && next->Name == "COMMENT" && curr->Line == next->Line) {
+ curr = next;
+ next = SkipWS(next + 1, end);
+ }
++curr;
break;
}