Skip to content

Commit 4b67e3b

Browse files
author
zhvv117
committed
Add NewLine after PushCurrentIndent and PopCurrentIndent
commit_hash:2ca6543f54f2475987f5ef7726011d9494ecba06
1 parent 724d11e commit 4b67e3b

File tree

87 files changed

+683
-370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+683
-370
lines changed

yql/essentials/sql/v1/format/sql_format.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ friend struct TStaticData;
874874
PushCurrentIndent();
875875
Visit(alt);
876876
PopCurrentIndent();
877+
NewLine();
877878
break;
878879
}
879880

@@ -992,6 +993,7 @@ friend struct TStaticData;
992993
switch (choice.Alt_case()) {
993994
case TRule_set_clause_choice::kAltSetClauseChoice1: {
994995
const auto& clauses = choice.GetAlt_set_clause_choice1().GetRule_set_clause_list1();
996+
NewLine();
995997
PushCurrentIndent();
996998
Visit(clauses.GetRule_set_clause1());
997999
for (auto& block : clauses.GetBlock2()) {
@@ -1001,6 +1003,7 @@ friend struct TStaticData;
10011003
}
10021004

10031005
PopCurrentIndent();
1006+
NewLine();
10041007
break;
10051008
}
10061009
case TRule_set_clause_choice::kAltSetClauseChoice2: {
@@ -1026,6 +1029,7 @@ friend struct TStaticData;
10261029
switch (simpleValues.Alt_case()) {
10271030
case TRule_simple_values_source::kAltSimpleValuesSource1: {
10281031
const auto& exprs = simpleValues.GetAlt_simple_values_source1().GetRule_expr_list1();
1032+
NewLine();
10291033
PushCurrentIndent();
10301034
Visit(exprs.GetRule_expr1());
10311035
for (const auto& block : exprs.GetBlock2()) {
@@ -1035,12 +1039,15 @@ friend struct TStaticData;
10351039
}
10361040

10371041
PopCurrentIndent();
1042+
NewLine();
10381043
break;
10391044
}
10401045
case TRule_simple_values_source::kAltSimpleValuesSource2: {
1046+
NewLine();
10411047
PushCurrentIndent();
10421048
Visit(simpleValues.GetAlt_simple_values_source2());
10431049
PopCurrentIndent();
1050+
NewLine();
10441051
break;
10451052
}
10461053
default:
@@ -1132,6 +1139,7 @@ friend struct TStaticData;
11321139
}
11331140

11341141
PopCurrentIndent();
1142+
NewLine();
11351143
}
11361144

11371145
void VisitAlterTable(const TRule_alter_table_stmt& msg) {
@@ -1149,6 +1157,7 @@ friend struct TStaticData;
11491157
}
11501158

11511159
PopCurrentIndent();
1160+
NewLine();
11521161
}
11531162

11541163
void VisitAlterTableStore(const TRule_alter_table_store_stmt& msg) {
@@ -1172,6 +1181,7 @@ friend struct TStaticData;
11721181
}
11731182

11741183
PopCurrentIndent();
1184+
NewLine();
11751185
}
11761186

11771187
void VisitDo(const TRule_do_stmt& msg) {
@@ -1255,6 +1265,7 @@ friend struct TStaticData;
12551265
}
12561266

12571267
PopCurrentIndent();
1268+
NewLine();
12581269
}
12591270

12601271
void VisitGrantPermissions(const TRule_grant_permissions_stmt& msg) {
@@ -1319,10 +1330,10 @@ friend struct TStaticData;
13191330
Visit(msg.GetBlock3());
13201331
Visit(msg.GetRule_topic_ref4());
13211332
if (msg.HasBlock5()) {
1322-
PushCurrentIndent();
13231333
auto& b = msg.GetBlock5().GetRule_create_topic_entries1();
13241334
Visit(b.GetToken1());
13251335
NewLine();
1336+
PushCurrentIndent();
13261337
Visit(b.GetRule_create_topic_entry2());
13271338
for (auto& subEntry : b.GetBlock3()) {
13281339
Visit(subEntry.GetToken1());
@@ -1362,6 +1373,7 @@ friend struct TStaticData;
13621373
}
13631374

13641375
PopCurrentIndent();
1376+
NewLine();
13651377
}
13661378

13671379
void VisitDropTopic(const TRule_drop_topic_stmt& msg) {
@@ -1392,6 +1404,7 @@ friend struct TStaticData;
13921404
}
13931405

13941406
PopCurrentIndent();
1407+
NewLine();
13951408
}
13961409

13971410
void VisitDropExternalDataSource(const TRule_drop_external_data_source_stmt& msg) {
@@ -1446,6 +1459,7 @@ friend struct TStaticData;
14461459
}
14471460

14481461
PopCurrentIndent();
1462+
NewLine();
14491463
}
14501464

14511465
void VisitDropResourcePool(const TRule_drop_resource_pool_stmt& msg) {
@@ -1489,6 +1503,7 @@ friend struct TStaticData;
14891503
}
14901504

14911505
PopCurrentIndent();
1506+
NewLine();
14921507
}
14931508

14941509
void VisitDropBackupCollection(const TRule_drop_backup_collection_stmt& msg) {
@@ -1519,6 +1534,7 @@ friend struct TStaticData;
15191534
}
15201535

15211536
PopCurrentIndent();
1537+
NewLine();
15221538
}
15231539

15241540
void VisitDropResourcePoolClassifier(const TRule_drop_resource_pool_classifier_stmt& msg) {
@@ -1963,6 +1979,7 @@ friend struct TStaticData;
19631979
case TRule_single_source::kAltSingleSource2: {
19641980
const auto& alt = msg.GetAlt_single_source2();
19651981
Visit(alt.GetToken1());
1982+
NewLine();
19661983
PushCurrentIndent();
19671984
Visit(alt.GetRule_select_stmt2());
19681985
PopCurrentIndent();
@@ -1973,6 +1990,7 @@ friend struct TStaticData;
19731990
case TRule_single_source::kAltSingleSource3: {
19741991
const auto& alt = msg.GetAlt_single_source3();
19751992
Visit(alt.GetToken1());
1993+
NewLine();
19761994
PushCurrentIndent();
19771995
Visit(alt.GetRule_values_stmt2());
19781996
PopCurrentIndent();
@@ -2320,6 +2338,7 @@ friend struct TStaticData;
23202338
}
23212339

23222340
PopCurrentIndent();
2341+
NewLine();
23232342
}
23242343

23252344
void VisitLambdaBody(const TRule_lambda_body& msg) {

0 commit comments

Comments
 (0)