1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 23:03:53 -04:00

add doc comment justifying ExprInheritFrom

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
pennae 2024-02-26 15:43:51 +01:00 committed by pennae
parent 1cd87b7042
commit f24e445bc0

View file

@ -135,6 +135,11 @@ struct ExprVar : Expr
COMMON_METHODS
};
/**
* A pseudo-expression for the purpose of evaluating the `from` expression in `inherit (from)` syntax.
* Unlike normal variable references, the displacement is set during parsing, and always refers to
* `ExprAttrs::inheritFromExprs` (by itself or in `ExprLet`), whose values are put into their own `Env`.
*/
struct ExprInheritFrom : ExprVar
{
ExprInheritFrom(PosIdx pos, Displacement displ): ExprVar(pos, {})