});
$tcl->CreateCommand('...' => sub {
$self->apply_to_state([ mode => 'shell' ]);
- my ($cur) = $self->shell_state->current_query_state;
+ my $orig = my $cur = $self->shell_state->current_query_state;
while ($cur) {
$self->_set_shell_state(
$self->shell_state->but(current_query_state => $cur)
$cur = eval { $cur->with_forced_backtrack };
push our @Result, [ output => $@ ] if $@;
}
+ $self->_set_shell_state(
+ $self->shell_state->but(
+ current_query_state => $orig
+ ),
+ );
+ return;
});
$tcl->CreateCommand(qlist => sub {
push our @Result, map [ output => $_ ], @{
),
);
});
+ $tcl->CreateCommand(trace => sub {
+ my (undef, undef, undef, @trace) = @_;
+ $self->_set_shell_state(
+ $self->shell_state->with_trace_changes(@trace)
+ );
+ });
return $tcl;
});