forked from lix-project/lix
Iterate over references
This commit is contained in:
parent
9eaebbf575
commit
22f2744afd
|
@ -113,11 +113,11 @@ static void addAttr(ExprAttrs * attrs, AttrPath & attrPath,
|
|||
// e and the expr pointed by the attr path are two attribute sets,
|
||||
// we want to merge them.
|
||||
// Otherwise, throw an error.
|
||||
ExprAttrs* ae = dynamic_cast<ExprAttrs *>(e);
|
||||
ExprAttrs* jAttrs = dynamic_cast<ExprAttrs *>(j->second.e);
|
||||
auto ae = dynamic_cast<ExprAttrs *>(e);
|
||||
auto jAttrs = dynamic_cast<ExprAttrs *>(j->second.e);
|
||||
if (jAttrs && ae) {
|
||||
for (auto ad: ae->attrs) {
|
||||
ExprAttrs::AttrDefs::iterator j2 = jAttrs->attrs.find(ad.first);
|
||||
for (auto & ad : ae->attrs) {
|
||||
auto j2 = jAttrs->attrs.find(ad.first);
|
||||
if (j2 != jAttrs->attrs.end()) // Attr already defined in iAttrs, error.
|
||||
dupAttr(ad.first, j2->second.pos, ad.second.pos);
|
||||
jAttrs->attrs[ad.first] = ad.second;
|
||||
|
|
Loading…
Reference in a new issue