aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
AgeCommit message (Collapse)Author
2023-04-17Merge remote-tracking branch 'upstream/master' into source-pathRobert Hensing
2023-04-16libexpr: Move identifier-like printing to print.ccRobert Hensing
2023-04-16libexpr/value/print.* -> libexpr/print.*Robert Hensing
Generalizes the file to sensibly allow printing any part of the language syntax.
2023-04-16printLiteral: Do not overloadRobert Hensing
2023-04-09Deduplicate string literal rendering, fix 4909Robert Hensing
2023-04-06improved help command listing.Henrik Karlsson
2023-04-06Origin: Use SourcePathEelco Dolstra
2023-04-06Backport SourcePath from the lazy-trees branchEelco Dolstra
This introduces the SourcePath type from lazy-trees as an abstraction for accessing files from inputs that may not be materialized in the real filesystem (e.g. Git repositories). Currently, however, it's just a wrapper around CanonPath, so it shouldn't change any behaviour. (On lazy-trees, SourcePath is a <InputAccessor, CanonPath> tuple.)
2023-04-04Merge pull request #7944 from yorickvP/fix-curReplThéophane Hufschmitt
NixRepl::mainLoop: restore old curRepl on function exit
2023-04-03Add explicit case statements where -Wswitch-enum would report themRobert Hensing
2023-03-02NixRepl::mainLoop: restore old curRepl on function exitYorick van Pelt
This fixes completion callbacks after entering and leaving a nested debugger.
2023-02-21Fix the build without GCJohn Ericson
I had given it an improper trailing comma in 1bd03ad100e8813751b6c08b0c21ae8cf5a9c21d.
2023-02-20Split out `CmdRepl` and `editorFor`John Ericson
The REPL itself and the `nix repl` CLI are conceptually different things, and thus deserve to be in different files.
2023-01-20Fix unreachable error messageGuillaume Maudoux
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-01-19Revert "Revert "Merge pull request #6204 from layus/coerce-string""Guillaume Maudoux
This reverts commit 9b33ef3879a764bed4cc2404a08344c3a697a646.
2023-01-18Revert "Merge pull request #6204 from layus/coerce-string"Robert Hensing
This reverts commit a75b7ba30f1e4f8b15e810fd18e63ee9552e0815, reversing changes made to 9af16c5f742300e831a2cc400e43df1e22f87f31.
2023-01-11Remove default constructor from `OutputsSpec`John Ericson
This forces us to be explicit. It also requires to rework how `from_json` works. A `JSON_IMPL` is added to assist with this.
2023-01-02Merge remote-tracking branch 'origin/master' into coerce-stringEelco Dolstra
2022-12-13Improve cast safetyEelco Dolstra
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-12-13Introduce AbstractPosEelco Dolstra
This makes the position object used in exceptions abstract, with a method getSource() to get the source code of the file in which the error originated. This is needed for lazy trees because source files don't necessarily exist in the filesystem, and we don't want to make libutil depend on the InputAccessor type in libfetcher.
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-11-28use logger->cout Naïm Favier
in order to avoid potential problems with the progress bar Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2022-11-28repl: print a newline on ctrl-DNaïm Favier
2022-11-02Temporarily disable the debugger during completion evaluationYorick van Pelt
readline is not re-entrant, so entering the debugger from the completioncallback results in an eventual segfault. The workaround is to temporarily disable the debugger when searching for possible completions.
2022-10-16Merge remote-tracking branch 'origin/master' into coerce-stringGuillaume Maudoux
2022-10-13Fix clang warningsEelco Dolstra
2022-09-20nix repl: warn if creating dir for history failsAlyssa Ross
The history is not critical to the functionality of nix repl, so it's enough to warn here, rather than refuse to start if the directory Nix thinks the history should live in can't be created.
2022-09-07WIP: broken merge but need a git checkpointGuillaume Maudoux
2022-08-22nix repl: Stop the progress barEelco Dolstra
The repl was broken since c3769c68465bae971ab6bb48cfcdea85b61ea83a. In general, the progress bar is incompatible with the repl.
2022-06-29Merge pull request #6233 from flox/nix-repl-flakesThéophane Hufschmitt
Nix repl flakes
2022-06-23Don't capture stdout when launching subshells in `nix repl`Dave Nicponski
2022-06-15Merge branch 'master' into nix-repl-flakesTom Bereknyei
2022-06-02Merge branch 'master' into nix-repl-flakesTom Bereknyei
2022-05-31repl: `--option pure-eval true` actually enables pure eval modeMaximilian Bosch
To quote Eelco in #5867: > Unfortunately we can't do > > evalSettings.pureEval.setDefault(false); > > because then we have to do the same in main.cc (where > pureEval is set to true), and that would allow pure-eval > to be disabled globally from nix.conf. Instead, a command should specify that it should be impure by default. Then, `evalSettings.pureEval` will be set to `false;` unless it's overridden by e.g. a CLI flag. In that case it's IMHO OK to be (theoretically) able to override `pure-eval` via `nix.conf` because it doesn't have an effect on commands where `forceImpureByDefault` returns `false` (i.e. everything where pure eval actually matters). Closes #5867
2022-05-25remove parens from repl helpBen Burdette
2022-05-25back to ref<EvalState> in NixReplBen Burdette
2022-05-25Style tweaksEelco Dolstra
2022-05-23commentBen Burdette
2022-05-22remove redundant 'debugMode' flagBen Burdette
2022-05-22change state derefsBen Burdette
2022-05-22changning repl to use EvalState& instead of refBen Burdette
2022-05-19'debugMode'Ben Burdette
2022-05-19de-const evalState exceptionsBen Burdette
2022-05-19Merge branch 'debug-exploratory-PR' into debuggerHook-eval-argBen Burdette
2022-05-19use an expr->StaticEnv table in evalStateBen Burdette
2022-05-16first whack at passing evalState as an arg to debuggerHook.Ben Burdette
2022-05-15remove extra argumentBen Burdette
2022-05-05fix repl bugBen Burdette
2022-05-05traceable_allocatorBen Burdette
2022-05-05rename debug commands to be more gdb-like; hide them except in debug modeBen Burdette