Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::ExprSelect Struct Reference
Inheritance diagram for nix::ExprSelect:
nix::Expr

Public Member Functions

 ExprSelect (std::pmr::polymorphic_allocator< char > &alloc, const PosIdx &pos, Expr *e, std::span< const AttrName > attrPath, Expr *def)
 ExprSelect (std::pmr::polymorphic_allocator< char > &alloc, const PosIdx &pos, Expr *e, Symbol name)
PosIdx getPos () const override
std::span< const AttrName > getAttrPath () const
Symbol evalExceptFinalSelect (EvalState &state, Env &env, Value &attrs)
void show (const SymbolTable &symbols, std::ostream &str) const override
void eval (EvalState &state, Env &env, Value &v) override
void bindVars (EvalState &es, const std::shared_ptr< const StaticEnv > &env) override
Public Member Functions inherited from nix::Expr
void eval (EvalState &state, Env &env, Value &v, std::string_view errorCtx)
virtual Value * maybeThunk (EvalState &state, Env &env)
virtual void evalForUpdate (EvalState &state, Env &env, UpdateQueue &q, std::string_view errorCtx)
virtual void setName (Symbol name)
virtual void setDocComment (DocComment docComment)
virtual void resetCursedOr ()
virtual void warnIfCursedOr (const SymbolTable &symbols, const PosTable &positions)

Public Attributes

PosIdx pos
uint32_t nAttrPath
Expr * e
Expr * def
AttrName * attrPathStart

Additional Inherited Members

Static Public Attributes inherited from nix::Expr
static Counter nrExprs

Member Function Documentation

◆ bindVars()

void nix::ExprSelect::bindVars ( EvalState & es,
const std::shared_ptr< const StaticEnv > & env )
overridevirtual

Reimplemented from nix::Expr.

◆ eval()

void nix::ExprSelect::eval ( EvalState & state,
Env & env,
Value & v )
overridevirtual

Normal evaluation, implemented directly by all subclasses.

Reimplemented from nix::Expr.

◆ evalExceptFinalSelect()

Symbol nix::ExprSelect::evalExceptFinalSelect ( EvalState & state,
Env & env,
Value & attrs )

Evaluate the a.b.c part of a.b.c.d. This exists mostly for the purpose of :doc in the repl.

Parameters
[out]attrsThe attribute set that should contain the last attribute name (if it exists).
Returns
The last attribute name in attrPath
Note
This does not evaluate the final attribute, and does not fail if that's the only attribute that does not exist.

◆ getAttrPath()

std::span< const AttrName > nix::ExprSelect::getAttrPath ( ) const
inline
Returns
std::span<const AttrName> starting at attrPathStart

◆ getPos()

PosIdx nix::ExprSelect::getPos ( ) const
inlineoverridevirtual

Reimplemented from nix::Expr.

◆ show()

void nix::ExprSelect::show ( const SymbolTable & symbols,
std::ostream & str ) const
overridevirtual

Reimplemented from nix::Expr.


The documentation for this struct was generated from the following files:
  • libexpr/include/nix/expr/nixexpr.hh
  • libexpr/eval.cc
  • libexpr/nixexpr.cc