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, {})