From 39e72c27f16b9bb07895e2a2d2d3a16f43449939 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 23 May 2020 16:01:52 +0100 Subject: docs(3p/nix/libexpr): Add comment on ExprSelect --- third_party/nix/src/libexpr/nixexpr.hh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'third_party/nix/src/libexpr') diff --git a/third_party/nix/src/libexpr/nixexpr.hh b/third_party/nix/src/libexpr/nixexpr.hh index 6d5d4f5f55e0..3ac651c94548 100644 --- a/third_party/nix/src/libexpr/nixexpr.hh +++ b/third_party/nix/src/libexpr/nixexpr.hh @@ -147,6 +147,13 @@ struct ExprVar : Expr { Value* maybeThunk(EvalState& state, Env& env); }; +// [tazjin] I *think* that this struct describes the syntactic +// construct for "selecting" something out of an attribute set, e.g. +// `a.b.c` => ExprSelect{"b", "c"}. +// +// Each path element has got a pointer to an expression, which seems +// to be the thing preceding its period, but afaict that is only set +// for the first one in a path. struct ExprSelect : Expr { Pos pos; Expr *e, *def; @@ -200,7 +207,7 @@ struct ExprList : Expr { struct Formal { Symbol name; - Expr* def; // def = default, not definition + Expr* def; // def = default, not definition Formal(const Symbol& name, Expr* def) : name(name), def(def){}; }; -- cgit 1.4.1