Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
eval.hh File Reference
#include "attr-set.hh"
#include "eval-error.hh"
#include "types.hh"
#include "value.hh"
#include "nixexpr.hh"
#include "symbol-table.hh"
#include "config.hh"
#include "experimental-features.hh"
#include "position.hh"
#include "pos-table.hh"
#include "source-accessor.hh"
#include "search-path.hh"
#include "repl-exit-status.hh"
#include "ref.hh"
#include <map>
#include <optional>
#include <functional>
#include "eval-inline.hh"

Go to the source code of this file.

Classes

class  nix::CallDepth
 
struct  nix::PrimOp
 
struct  nix::Constant
 
struct  nix::Env
 
struct  nix::DebugTrace
 
class  nix::EvalState
 
struct  nix::EvalState::Doc
 
struct  nix::DebugTraceStacker
 

Typedefs

using nix::PrimOpFun = void(EvalState & state, const PosIdx pos, Value * * args, Value & v)
 
typedef std::map< std::string, Value *, std::less< std::string >, traceable_allocator< std::pair< const std::string, Value * > > > nix::ValMap
 
typedef std::unordered_map< PosIdx, DocCommentnix::DocCommentMap
 

Functions

std::ostream & nix::operator<< (std::ostream &output, const PrimOp &primOp)
 
void nix::printEnvBindings (const EvalState &es, const Expr &expr, const Env &env)
 
void nix::printEnvBindings (const SymbolTable &st, const StaticEnv &se, const Env &env, int lvl)
 
std::unique_ptr< ValMap > nix::mapStaticEnvBindings (const SymbolTable &st, const StaticEnv &se, const Env &env)
 
void nix::copyContext (const Value &v, NixStringContext &context)
 
std::string nix::printValue (EvalState &state, Value &v)
 
std::ostream & nix::operator<< (std::ostream &os, const ValueType t)
 
std::shared_ptr< RegexCachenix::makeRegexCache ()
 
std::string_view nix::showType (ValueType type, bool withArticle)
 
std::string nix::showType (const Value &v)
 
SourcePath nix::resolveExprPath (SourcePath path, bool addDefaultNix)
 
bool nix::isAllowedURI (std::string_view uri, const Strings &allowedUris)
 

Variables

constexpr size_t nix::maxPrimOpArity = 8
 

Typedef Documentation

◆ PrimOpFun

using nix::PrimOpFun = void(EvalState & state, const PosIdx pos, Value * * args, Value & v)

Function that implements a primop.

Function Documentation

◆ isAllowedURI()

bool nix::isAllowedURI ( std::string_view uri,
const Strings & allowedPaths )

Whether a URI is allowed, assuming restrictEval is enabled

◆ resolveExprPath()

SourcePath nix::resolveExprPath ( SourcePath path,
bool addDefaultNix = true )

If path refers to a directory, then append "/default.nix".

Parameters
addDefaultNixWhether to append "/default.nix" after resolving symlinks.

◆ showType()

std::string_view nix::showType ( ValueType type,
bool withArticle = true )
Returns
A string representing the type of the value v.
Parameters
withArticleWhether to begin with an english article, e.g. "an integer" vs "integer".

Variable Documentation

◆ maxPrimOpArity

size_t nix::maxPrimOpArity = 8
constexpr

We put a limit on primop arity because it lets us use a fixed size array on the stack. 8 is already an impractical number of arguments. Use an attrset argument for such overly complicated functions.