give ExprInheritFrom a handle to what its standing in for

Change-Id: I12088e0b618407e5432523bbc97be63c8d6fce62
This commit is contained in:
Qyriad
2024-07-04 15:55:38 -06:00
parent e040b762a4
commit 4f0c27abe1
3 changed files with 16 additions and 8 deletions
+5 -2
View File
@@ -144,7 +144,10 @@ struct ExprVar : Expr
*/
struct ExprInheritFrom : ExprVar
{
ExprInheritFrom(PosIdx pos, Displacement displ): ExprVar(pos, {})
ref<Expr> fromExpr;
ExprInheritFrom(PosIdx pos, Displacement displ, ref<Expr> fromExpr)
: ExprVar(pos, {}), fromExpr(fromExpr)
{
this->level = 0;
this->displ = displ;
@@ -222,7 +225,7 @@ struct ExprAttrs : Expr
};
typedef std::map<Symbol, AttrDef> AttrDefs;
AttrDefs attrs;
std::unique_ptr<std::vector<std::unique_ptr<Expr>>> inheritFromExprs;
std::unique_ptr<std::vector<ref<Expr>>> inheritFromExprs;
struct DynamicAttrDef {
std::unique_ptr<Expr> nameExpr, valueExpr;
PosIdx pos;