aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-08 09:51:27 +0100
committereldritch horrors <pennae@lix.systems>2024-03-10 03:18:32 -0600
commit03f852b2c69233667de839a4777331114304c983 (patch)
tree1c4b3b1c695708b6d3ed8acaaa978d7f653b980b /src/libexpr/parser.y
parent3e43f4aeff2947aea98bb0d538fa686bd55a1385 (diff)
preserve information about whether/how an attribute was inherited
(cherry picked from commit c66ee57edc6cac3571bfbf77d0c0ea4d25b4e805) Change-Id: Ie8606a8b2f5946c87dd4d16b7b46203e199a4cc1
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 447e4d61a..ae5723a6f 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -311,7 +311,9 @@ binds
if ($$->attrs.find(i.symbol) != $$->attrs.end())
state->dupAttr(i.symbol, state->at(@3), $$->attrs[i.symbol].pos);
auto pos = state->at(@3);
- $$->attrs.emplace(i.symbol, ExprAttrs::AttrDef(new ExprVar(CUR_POS, i.symbol), pos, true));
+ $$->attrs.emplace(
+ i.symbol,
+ ExprAttrs::AttrDef(new ExprVar(CUR_POS, i.symbol), pos, ExprAttrs::AttrDef::Kind::Inherited));
}
delete $3;
}
@@ -321,7 +323,12 @@ binds
for (auto & i : *$6) {
if ($$->attrs.find(i.symbol) != $$->attrs.end())
state->dupAttr(i.symbol, state->at(@6), $$->attrs[i.symbol].pos);
- $$->attrs.emplace(i.symbol, ExprAttrs::AttrDef(new ExprSelect(CUR_POS, $4, i.symbol), state->at(@6)));
+ $$->attrs.emplace(
+ i.symbol,
+ ExprAttrs::AttrDef(
+ new ExprSelect(CUR_POS, $4, i.symbol),
+ state->at(@6),
+ ExprAttrs::AttrDef::Kind::InheritedFrom));
}
delete $6;
}