We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ecdd93 commit 7fb5cbcCopy full SHA for 7fb5cbc
internal/repl/repl.go
@@ -432,7 +432,7 @@ func (s *Session) separateEvalStmt(in string) error {
432
433
for _, line := range inLines {
434
435
- if bracketCount == 0 {
+ if bracketCount == 0 && len(stmtLines) == 0 {
436
if _, err := s.evalExpr(line); err != nil {
437
if strings.LastIndex(line, "{") == len(line)-1 {
438
bracketCount++
@@ -443,6 +443,17 @@ func (s *Session) separateEvalStmt(in string) error {
443
continue
444
}
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
+
457
if strings.LastIndex(line, "}") == len(line)-1 {
458
bracketCount--
459
0 commit comments