File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -432,7 +432,7 @@ func (s *Session) separateEvalStmt(in string) error {
432
432
433
433
for _ , line := range inLines {
434
434
435
- if bracketCount == 0 {
435
+ if bracketCount == 0 && len ( stmtLines ) == 0 {
436
436
if _ , err := s .evalExpr (line ); err != nil {
437
437
if strings .LastIndex (line , "{" ) == len (line )- 1 {
438
438
bracketCount ++
@@ -443,6 +443,17 @@ func (s *Session) separateEvalStmt(in string) error {
443
443
continue
444
444
}
445
445
446
+ if bracketCount == 0 && len (stmtLines ) > 0 {
447
+ var noPrint bool
448
+ if exprCount > 0 {
449
+ noPrint = true
450
+ }
451
+ if err := s .evalStmt (strings .Join (stmtLines , "\n " ), noPrint ); err != nil {
452
+ return err
453
+ }
454
+ stmtLines = []string {}
455
+ }
456
+
446
457
if strings .LastIndex (line , "}" ) == len (line )- 1 {
447
458
bracketCount --
448
459
}
You can’t perform that action at this time.
0 commit comments