From afc6c1bad63e27d68adf49e673f8aafd36495a8a Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 15 Jul 2013 17:10:18 -0400 Subject: Simplify inherited attribute handling This reduces the difference between inherited and non-inherited attribute handling to the choice of which env to use (in recs and lets) by setting the AttrDef::e to a new ExprVar in the parser rather than carrying a separate AttrDef::v VarRef member. As an added bonus, this allows inherited attributes that inherit from a with to delay forcing evaluation of the with's attributes. Signed-off-by: Shea Levy --- src/libexpr/parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libexpr/parser.y') diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index 7690271a86d3..0e3086004271 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -413,7 +413,7 @@ binds if ($$->attrs.find(*i) != $$->attrs.end()) dupAttr(*i, makeCurPos(@3, data), $$->attrs[*i].pos); Pos pos = makeCurPos(@3, data); - $$->attrs[*i] = ExprAttrs::AttrDef(*i, pos); + $$->attrs[*i] = ExprAttrs::AttrDef(new ExprVar(*i), pos, true); } } | binds INHERIT '(' expr ')' attrs ';' -- cgit 1.4.1