about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-23T15·01+0100
committerVincent Ambo <tazjin@google.com>2020-05-23T15·01+0100
commit39e72c27f16b9bb07895e2a2d2d3a16f43449939 (patch)
tree5d201104bf54accf59de0a6b75217bf29f1acd4a /third_party/nix/src/libexpr/nixexpr.hh
parentbca0e348597371ced98ce9a4c071491cf56534db (diff)
docs(3p/nix/libexpr): Add comment on ExprSelect r/826
Diffstat (limited to 'third_party/nix/src/libexpr/nixexpr.hh')
-rw-r--r--third_party/nix/src/libexpr/nixexpr.hh9
1 files changed, 8 insertions, 1 deletions
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){};
 };