Files
lix/lix/libcmd/repl.hh
T
eldritch horrors fc58e7b217 libexpr: mark eval error handling NeverAsync
technically it doesn't *have* to be NeverAsync, but not marking it as
such unconditionally requires templating DebugState over asyncness of
its callback (which then requires templating EvalState, which, *NO*.)

Change-Id: I4980d45b541c2e40328beac139b18c6c1ba0957c
2025-03-25 21:26:47 +01:00

42 lines
810 B
C++

#pragma once
///@file
#include "lix/libexpr/eval.hh"
#include "lix/libutil/types.hh"
namespace nix {
struct AbstractNixRepl : NeverAsync
{
typedef std::vector<std::pair<Value*,std::string>> AnnotatedValues;
static ReplExitStatus
run(const SearchPath & searchPath,
nix::ref<Store> store,
EvalState & state,
std::function<AnnotatedValues()> getValues,
const ValMap & extraEnv,
Bindings * autoArgs);
static ReplExitStatus runSimple(
EvalState & evalState,
const ValMap & extraEnv);
protected:
EvalState & state;
Bindings * autoArgs;
AbstractNixRepl(EvalState & state)
: state(state)
{ }
virtual ~AbstractNixRepl()
{ }
virtual void initEnv() = 0;
virtual ReplExitStatus mainLoop() = 0;
};
}