81a0624d76
When pretty-printing is enabled, previously an unforced thunk would trigger indentation, even when it subsequently does not evaluate to a nested structure. The resulting output looked inconsistent, and furthermore pretty-printing was not idempotent (since pretty-printing the same value again, which is now fully evaluated, will not trigger indentation). When strict evaluation is enabled, force the item before inspecting its type, so that it is properly known whether it contains a nested structure. Furthermore, there is no need to cause indentation for unforced thunks, since the very next operation will be printing them as `«thunk»`. This is mostly a port of https://github.com/NixOS/nix/pull/11100 , but we only force the item when it's going to be forced anyway due to strict pretty-printing, and a new test was written since the REPL testing framework in Lix is different. Co-Authored-By: Robert Hensing <robert@roberthensing.nl> Change-Id: Ib7560fe531d09e05ca6b2037a523fe21a26d9d58 |
||
---|---|---|
.. | ||
extra_data | ||
basic.ast | ||
basic.test | ||
basic_repl.test | ||
basic_tidied.ast | ||
basic_tidied.test | ||
errors.test | ||
idempotent.test | ||
no_nested_debuggers.nix | ||
no_nested_debuggers.test | ||
regression_9917.nix | ||
regression_9917.test | ||
regression_9918.nix | ||
regression_9918.test | ||
regression_l145.nix | ||
regression_l145.test | ||
repl_overlays.nix | ||
repl_overlays.test | ||
repl_overlays_compose.nix | ||
repl_overlays_compose.test | ||
repl_overlays_destructure_without_dotdotdot_errors.test | ||
repl_overlays_destructure_without_formals_ok.test | ||
repl_overlays_error.test | ||
repl_printing.test | ||
stack_vars.nix | ||
stack_vars.test |