Commit fab8b80 1 parent 400065c commit fab8b80 Copy full SHA for fab8b80
File tree 2 files changed +38
-1
lines changed
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,43 @@ func TestSOQL(t *testing.T) {
313
313
Start__c = YESTERDAY
314
314
)
315
315
]` },
316
+
317
+ {
318
+ `[
319
+ SELECT
320
+ Name
321
+ FROM
322
+ My_Object__c
323
+ WHERE
324
+ Type__c = 'Virtual' AND
325
+ (
326
+ Start__c = TODAY OR
327
+ Start__c = N_DAYS_AGO:7 OR
328
+ Start__c = N_DAYS_AGO:14 OR
329
+ Start__c = N_DAYS_AGO:21 OR
330
+ Start__c <= N_DAYS_AGO:28
331
+ ) AND
332
+ Status__c = 'Confirmed'
333
+ ORDER BY
334
+ Start__c
335
+ ];` , `[
336
+ SELECT
337
+ Name
338
+ FROM
339
+ My_Object__c
340
+ WHERE
341
+ Type__c = 'Virtual' AND
342
+ (
343
+ Start__c = TODAY OR
344
+ Start__c = N_DAYS_AGO:7 OR
345
+ Start__c = N_DAYS_AGO:14 OR
346
+ Start__c = N_DAYS_AGO:21 OR
347
+ Start__c <= N_DAYS_AGO:28
348
+ ) AND
349
+ Status__c = 'Confirmed'
350
+ ORDER BY
351
+ Start__c
352
+ ]` },
316
353
}
317
354
for _ , tt := range tests {
318
355
input := antlr .NewInputStream (tt .input )
Original file line number Diff line number Diff line change @@ -947,7 +947,7 @@ func (v *FormatVisitor) VisitLogicalExpression(ctx *parser.LogicalExpressionCont
947
947
func (v * FormatVisitor ) VisitConditionalExpression (ctx * parser.ConditionalExpressionContext ) interface {} {
948
948
switch {
949
949
case ctx .LogicalExpression () != nil :
950
- return fmt .Sprintf ("(%s )" , v .visitRule (ctx .LogicalExpression ()))
950
+ return fmt .Sprintf ("(\n %s \n )" , v .indent ( v . visitRule (ctx .LogicalExpression ()).( string )))
951
951
case ctx .FieldExpression () != nil :
952
952
return v .visitRule (ctx .FieldExpression ())
953
953
}
You can’t perform that action at this time.
0 commit comments