From c6ab185e05d0451195fadf51cb4ca9e5760dbdf9 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Mon, 21 Feb 2022 17:47:47 -0500 Subject: [PATCH] Let mlr repl print empty strings --- internal/pkg/auxents/repl/dsl.go | 8 ++++---- internal/pkg/auxents/repl/session.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/pkg/auxents/repl/dsl.go b/internal/pkg/auxents/repl/dsl.go index b59ca0a525..4de8b704d7 100644 --- a/internal/pkg/auxents/repl/dsl.go +++ b/internal/pkg/auxents/repl/dsl.go @@ -84,16 +84,16 @@ func (repl *Repl) handleDSLStringAux( // statement like 'true' or '$x > 0.5' etc. For the REPL, we re-use this for // interactive expressions to be printed to the terminal. For the main DSL, // the default is mlrval.FromTrue(); for the REPL, the default is - // mlrval.VOID. + // mlrval.NULL. filterExpression := repl.runtimeState.FilterExpression - if filterExpression.IsVoid() { + if filterExpression.IsNull() { // nothing to print - } else if filterExpression.IsString() { + } else if filterExpression.IsStringOrVoid() { fmt.Printf("\"%s\"\n", filterExpression.String()) } else { fmt.Println(filterExpression.String()) } - repl.runtimeState.FilterExpression = mlrval.VOID + repl.runtimeState.FilterExpression = mlrval.NULL } return nil diff --git a/internal/pkg/auxents/repl/session.go b/internal/pkg/auxents/repl/session.go index 57db444f3c..4a73c35233 100644 --- a/internal/pkg/auxents/repl/session.go +++ b/internal/pkg/auxents/repl/session.go @@ -69,8 +69,8 @@ func NewRepl( // statement like 'true' or '$x > 0.5' etc. For the REPL, we re-use this for // interactive expressions to be printed to the terminal. For the main DSL, // the default is mlrval.FromTrue(); for the REPL, the default is - // mlrval.VOID. - runtimeState.FilterExpression = mlrval.VOID + // mlrval.NULL. + runtimeState.FilterExpression = mlrval.NULL // For control-C handling sysToSignalHandlerChannel := make(chan os.Signal, 1) // Our signal handler reads system notification here