@@ -126,20 +126,20 @@ inline void ParserState::addAttr(
126126 for (i = attrPath.begin (); i + 1 < attrPath.end (); i++) {
127127 ExprAttrs * nested;
128128 if (i->symbol ) {
129- ExprAttrs::AttrDefs::iterator j = attrs->attrs . find (i->symbol );
130- if (j != attrs->attrs . end ()) {
129+ ExprAttrs::AttrDefs::iterator j = attrs->attrs -> find (i->symbol );
130+ if (j != attrs->attrs -> end ()) {
131131 nested = dynamic_cast <ExprAttrs *>(j->second .e );
132132 if (!nested) {
133133 attrPath.erase (i + 1 , attrPath.end ());
134134 dupAttr (attrPath, pos, j->second .pos );
135135 }
136136 } else {
137137 nested = exprs.add <ExprAttrs>();
138- attrs->attrs [i->symbol ] = ExprAttrs::AttrDef (nested, pos);
138+ (* attrs->attrs ) [i->symbol ] = ExprAttrs::AttrDef (nested, pos);
139139 }
140140 } else {
141141 nested = exprs.add <ExprAttrs>();
142- attrs->dynamicAttrs . push_back (ExprAttrs::DynamicAttrDef (i->expr , nested, pos));
142+ attrs->dynamicAttrs -> push_back (ExprAttrs::DynamicAttrDef (i->expr , nested, pos));
143143 }
144144 attrs = nested;
145145 }
@@ -148,7 +148,7 @@ inline void ParserState::addAttr(
148148 if (i->symbol ) {
149149 addAttr (attrs, attrPath, i->symbol , ExprAttrs::AttrDef (e, pos));
150150 } else {
151- attrs->dynamicAttrs . push_back (ExprAttrs::DynamicAttrDef (i->expr , e, pos));
151+ attrs->dynamicAttrs -> push_back (ExprAttrs::DynamicAttrDef (i->expr , e, pos));
152152 }
153153
154154 auto it = lexerState.positionToDocComment .find (pos);
@@ -165,8 +165,8 @@ inline void ParserState::addAttr(
165165inline void
166166ParserState::addAttr (ExprAttrs * attrs, AttrPath & attrPath, const Symbol & symbol, ExprAttrs::AttrDef && def)
167167{
168- ExprAttrs::AttrDefs::iterator j = attrs->attrs . find (symbol);
169- if (j != attrs->attrs . end ()) {
168+ ExprAttrs::AttrDefs::iterator j = attrs->attrs -> find (symbol);
169+ if (j != attrs->attrs -> end ()) {
170170 // This attr path is already defined. However, if both
171171 // e and the expr pointed by the attr path are two attribute sets,
172172 // we want to merge them.
@@ -182,7 +182,7 @@ ParserState::addAttr(ExprAttrs * attrs, AttrPath & attrPath, const Symbol & symb
182182 if (jAttrs && ae) {
183183 if (ae->inheritFromExprs && !jAttrs->inheritFromExprs )
184184 jAttrs->inheritFromExprs = std::make_unique<std::pmr::vector<Expr *>>();
185- for (auto & ad : ae->attrs ) {
185+ for (auto & ad : * ae->attrs ) {
186186 if (ad.second .kind == ExprAttrs::AttrDef::Kind::InheritedFrom) {
187187 auto & sel = dynamic_cast <ExprSelect &>(*ad.second .e );
188188 auto & from = dynamic_cast <ExprInheritFrom &>(*sel.e );
@@ -192,12 +192,12 @@ ParserState::addAttr(ExprAttrs * attrs, AttrPath & attrPath, const Symbol & symb
192192 addAttr (jAttrs, attrPath, ad.first , std::move (ad.second ));
193193 attrPath.pop_back ();
194194 }
195- ae->attrs . clear ();
196- jAttrs->dynamicAttrs . insert (
197- jAttrs->dynamicAttrs . end (),
198- std::make_move_iterator (ae->dynamicAttrs . begin ()),
199- std::make_move_iterator (ae->dynamicAttrs . end ()));
200- ae->dynamicAttrs . clear ();
195+ ae->attrs -> clear ();
196+ jAttrs->dynamicAttrs -> insert (
197+ jAttrs->dynamicAttrs -> end (),
198+ std::make_move_iterator (ae->dynamicAttrs -> begin ()),
199+ std::make_move_iterator (ae->dynamicAttrs -> end ()));
200+ ae->dynamicAttrs -> clear ();
201201 if (ae->inheritFromExprs ) {
202202 jAttrs->inheritFromExprs ->insert (
203203 jAttrs->inheritFromExprs ->end (),
@@ -210,7 +210,7 @@ ParserState::addAttr(ExprAttrs * attrs, AttrPath & attrPath, const Symbol & symb
210210 }
211211 } else {
212212 // This attr path is not defined. Let's create it.
213- attrs->attrs . emplace (symbol, def);
213+ attrs->attrs -> emplace (symbol, def);
214214 def.e ->setName (symbol);
215215 }
216216}
0 commit comments