if (!litem.second.SideEffect && num != llist.size() - 1) {
yyerror(&litem.second.DebugInfo, NULL, NULL, "Value computed is not used.");
}
- dlist.push_back(std::move(litem.first));
+ dlist.emplace_back(std::move(litem.first));
num++;
}
lterm_items_inner: lterm %dprec 2
{
$$ = new std::vector<std::pair<std::unique_ptr<Expression>, EItemInfo> >();
- EItemInfo info = { true, @1 };
- $$->emplace_back(std::unique_ptr<Expression>($1), info);
+ $$->emplace_back(std::unique_ptr<Expression>($1), EItemInfo{true, @1});
}
| rterm_no_side_effect
{
$$ = new std::vector<std::pair<std::unique_ptr<Expression>, EItemInfo> >();
- EItemInfo info = { false, @1 };
- $$->emplace_back(std::unique_ptr<Expression>($1), info);
+ $$->emplace_back(std::unique_ptr<Expression>($1), EItemInfo{false, @1});
}
| lterm_items_inner sep lterm %dprec 1
{
$$ = new std::vector<std::pair<std::unique_ptr<Expression>, EItemInfo> >();
if ($3) {
- EItemInfo info = { true, @3 };
- $$->emplace_back(std::unique_ptr<Expression>($3), info);
+ $$->emplace_back(std::unique_ptr<Expression>($3), EItemInfo{true, @3});
}
}
| lterm_items_inner sep rterm_no_side_effect %dprec 1
$$ = new std::vector<std::pair<std::unique_ptr<Expression>, EItemInfo> >();
if ($3) {
- EItemInfo info = { false, @3 };
- $$->emplace_back(std::unique_ptr<Expression>($3), info);
+ $$->emplace_back(std::unique_ptr<Expression>($3), EItemInfo{false, @3});
}
}
;
identifier_items_inner: identifier
{
$$ = new std::vector<String>();
- $$->push_back(*$1);
+ $$->emplace_back(std::move(*$1));
delete $1;
}
| identifier_items_inner ',' identifier
else
$$ = new std::vector<String>();
- $$->push_back(*$3);
+ $$->emplace_back(std::move(*$3));
delete $3;
}
;
for (auto& litem : *$3) {
if (!litem.second.SideEffect)
yyerror(&litem.second.DebugInfo, NULL, NULL, "Value computed is not used.");
- dlist.push_back(std::move(litem.first));
+ dlist.emplace_back(std::move(litem.first));
}
delete $3;
$$ = new DictExpression(std::move(dlist), @$);
for (auto& litem : *$3) {
if (!litem.second.SideEffect)
yyerror(&litem.second.DebugInfo, NULL, NULL, "Value computed is not used.");
- dlist.push_back(std::move(litem.first));
+ dlist.emplace_back(std::move(litem.first));
}
delete $3;
$$ = new DictExpression(std::move(dlist), @$);
for (auto& litem : *$3) {
if (!litem.second.SideEffect && num != $3->size() - 1)
yyerror(&litem.second.DebugInfo, NULL, NULL, "Value computed is not used.");
- dlist.push_back(std::move(litem.first));
+ dlist.emplace_back(std::move(litem.first));
num++;
}
delete $3;
| else_if_branches else_if_branch
{
$$ = $1;
- $$->push_back(std::move(*$2));
+ $$->emplace_back(std::move(*$2));
delete $2;
}
;
EndFlowControlBlock(context);
std::vector<String> args;
- args.push_back(*$1);
+ args.emplace_back(std::move(*$1));
delete $1;
$$ = new FunctionExpression("<anonymous>", args, {}, std::unique_ptr<Expression>($4), @$);
ASSERT(!dynamic_cast<DictExpression *>($3));
std::vector<String> args;
- args.push_back(*$1);
+ args.emplace_back(std::move(*$1));
delete $1;
$$ = new FunctionExpression("<anonymous>", args, {}, std::unique_ptr<Expression>($3), @$);
for (auto& litem : *$3) {
if (!litem.second.SideEffect && num != $3->size() - 1)
yyerror(&litem.second.DebugInfo, NULL, NULL, "Value computed is not used.");
- dlist.push_back(std::move(litem.first));
+ dlist.emplace_back(std::move(litem.first));
num++;
}
delete $3;