File tree 1 file changed +12
-14
lines changed
1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -433,36 +433,34 @@ func (s *Session) separateEvalStmt(in string) error {
433
433
for _ , line := range inLines {
434
434
435
435
if bracketCount == 0 && len (stmtLines ) == 0 {
436
- if _ , err := s .evalExpr (line ); err != nil {
436
+ _ , err := s .evalExpr (line )
437
+ if err != nil {
437
438
if strings .LastIndex (line , "{" ) == len (line )- 1 {
438
439
bracketCount ++
439
440
}
440
- stmtLines = append (stmtLines , line )
441
+ }
442
+ if err == nil {
441
443
continue
442
444
}
443
- continue
444
445
}
445
446
447
+ if strings .LastIndex (line , "}" ) == len (line )- 1 {
448
+ bracketCount --
449
+ }
450
+ stmtLines = append (stmtLines , line )
451
+
446
452
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 {
453
+ if err := s .evalStmt (strings .Join (stmtLines , "\n " ), true ); err != nil {
452
454
return err
453
455
}
454
456
stmtLines = []string {}
457
+ continue
455
458
}
456
459
457
- if strings .LastIndex (line , "}" ) == len (line )- 1 {
458
- bracketCount --
459
- }
460
- stmtLines = append (stmtLines , line )
461
-
462
460
exprCount ++
463
461
}
464
462
465
- if len (stmtLines ) != 0 {
463
+ if len (stmtLines ) > 0 {
466
464
var noPrint bool
467
465
if exprCount > 0 {
468
466
noPrint = true
You can’t perform that action at this time.
0 commit comments