Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let mlr repl print empty strings #959

Merged
merged 1 commit into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/pkg/auxents/repl/dsl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/auxents/repl/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down