Skip to content

Commit 9da04a3

Browse files
committed
More simplify
1 parent 063520f commit 9da04a3

2 files changed

Lines changed: 2 additions & 28 deletions

File tree

src/expr_parser.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,9 @@ Expr ExprParser::parseExpr()
463463
{
464464
// now parse attribute list
465465
AttrMap attrs;
466-
bool pushedScope = false;
467466
// NOTE parsing attributes may trigger recursive calls to this
468467
// method.
469-
parseAttributeList(Kind::NONE, ret, attrs, pushedScope);
470-
// the scope of the variable is one level up
471-
if (pushedScope && pstack.size()>1)
472-
{
473-
pstack[pstack.size()-2].d_nscopes++;
474-
}
468+
parseAttributeList(Kind::NONE, ret, attrs);
475469
// process the attributes
476470
for (std::pair<const Attr, std::vector<Expr>>& a : attrs)
477471
{
@@ -1098,7 +1092,7 @@ std::string ExprParser::parseStr(bool unescape)
10981092
}
10991093

11001094
void ExprParser::parseAttributeList(
1101-
Kind k, Expr& e, AttrMap& attrs, bool& pushedScope, Kind plk)
1095+
Kind k, Expr& e, AttrMap& attrs, Kind plk)
11021096
{
11031097
std::map<std::string, Attr>::iterator its;
11041098
// while the next token is KEYWORD, exit if RPAREN
@@ -1237,17 +1231,6 @@ void ExprParser::parseAttributeList(
12371231
d_lex.reinsertToken(Token::RPAREN);
12381232
}
12391233

1240-
void ExprParser::parseAttributeList(Kind k, Expr& e, AttrMap& attrs, Kind plk)
1241-
{
1242-
bool pushedScope = false;
1243-
parseAttributeList(k, e, attrs, pushedScope, plk);
1244-
// pop the scope if necessary
1245-
if (pushedScope)
1246-
{
1247-
d_state.popScope();
1248-
}
1249-
}
1250-
12511234
Kind ExprParser::parseLiteralKind()
12521235
{
12531236
std::string name = parseSymbol();

src/expr_parser.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,9 @@ class ExprParser
128128
* - NONE otherwise.
129129
* @param e The expression we are applying to
130130
* @param attr The attributes which are populated
131-
* @param pushedScope True if we pushed a scope while reading the list. This
132-
* is true when e.g. the attribute :var is read. The caller of this method
133-
* is responsible for popping the scope.
134131
* @param plk If k is PARAM, this is the category of the parameter list
135132
* which that parameter belongs to
136133
*/
137-
void parseAttributeList(Kind k,
138-
Expr& e,
139-
AttrMap& attrs,
140-
bool& pushedScope,
141-
Kind plk = Kind::NONE);
142-
/** Same as above, but ensures we pop the scope */
143134
void parseAttributeList(Kind k,
144135
Expr& e,
145136
AttrMap& attrs,

0 commit comments

Comments
 (0)