@@ -345,8 +345,8 @@ string_parts
345345
346346string_parts_interpolated
347347 : string_parts_interpolated STR
348- { $$ = $1 ; $$.emplace_back(state->at(@2), new ExprString(state->alloc, $2)); }
349- | string_parts_interpolated DOLLAR_CURLY expr '}' { $$ = $1 ; $$.emplace_back(state->at(@2), $3); }
348+ { $$ = std::move($1) ; $$.emplace_back(state->at(@2), new ExprString(state->alloc, $2)); }
349+ | string_parts_interpolated DOLLAR_CURLY expr '}' { $$ = std::move($1) ; $$.emplace_back(state->at(@2), $3); }
350350 | DOLLAR_CURLY expr '}' { $$.emplace_back(state->at(@1), $2); }
351351 | STR DOLLAR_CURLY expr '}' {
352352 $$.emplace_back(state->at(@1), new ExprString(state->alloc, $1));
@@ -391,8 +391,8 @@ path_start
391391 ;
392392
393393ind_string_parts
394- : ind_string_parts IND_STR { $$ = $1 ; $$.emplace_back(state->at(@2), $2); }
395- | ind_string_parts DOLLAR_CURLY expr '}' { $$ = $1 ; $$.emplace_back(state->at(@2), $3); }
394+ : ind_string_parts IND_STR { $$ = std::move($1) ; $$.emplace_back(state->at(@2), $2); }
395+ | ind_string_parts DOLLAR_CURLY expr '}' { $$ = std::move($1) ; $$.emplace_back(state->at(@2), $3); }
396396 | { }
397397 ;
398398
@@ -440,11 +440,11 @@ binds1
440440 ;
441441
442442attrs
443- : attrs attr { $$ = $1 ; $$.emplace_back(AttrName( state->symbols.create($2) ), state->at(@2)); }
443+ : attrs attr { $$ = std::move($1) ; $$.emplace_back(state->symbols.create($2), state->at(@2)); }
444444 | attrs string_attr
445- { $$ = $1 ;
445+ { $$ = std::move($1) ;
446446 std ::visit (overloaded {
447- [&](std::string_view str) { $$ .emplace_back(AttrName( state->symbols.create(str) ), state->at (@2 )); },
447+ [&](std::string_view str) { $$ .emplace_back(state->symbols.create(str), state->at (@2 )); },
448448 [&](Expr * expr) {
449449 throw ParseError ({
450450 .msg = HintFmt (" dynamic attributes not allowed in inherit" ),
@@ -457,20 +457,20 @@ attrs
457457 ;
458458
459459attrpath
460- : attrpath '.' attr { $$ = $1 ; $$.push_back(AttrName( state->symbols.create($3) )); }
460+ : attrpath '.' attr { $$ = std::move($1) ; $$.emplace_back( state->symbols.create($3)); }
461461 | attrpath '.' string_attr
462- { $$ = $1 ;
462+ { $$ = std::move($1) ;
463463 std ::visit (overloaded {
464- [&](std::string_view str) { $$ .push_back(AttrName( state->symbols.create(str) )); },
465- [&](Expr * expr) { $$ .push_back(AttrName( expr) ); }
466- }, $3 );
464+ [&](std::string_view str) { $$ .emplace_back( state->symbols.create(str)); },
465+ [&](Expr * expr) { $$ .emplace_back( expr); }
466+ }, std :: move ($3) );
467467 }
468- | attr { $$.push_back(AttrName( state->symbols.create($1) )); }
468+ | attr { $$.emplace_back( state->symbols.create($1)); }
469469 | string_attr
470470 { std::visit(overloaded {
471- [&](std::string_view str) { $$.push_back(AttrName( state->symbols.create(str) )); },
472- [&](Expr * expr) { $$.push_back(AttrName( expr) ); }
473- }, $1 );
471+ [&](std::string_view str) { $$.emplace_back( state->symbols.create(str)); },
472+ [&](Expr * expr) { $$.emplace_back( expr); }
473+ }, std::move($1) );
474474 }
475475 ;
476476
480480 ;
481481
482482string_attr
483- : '"' string_parts '"' { $$ = $2 ; }
483+ : '"' string_parts '"' { $$ = std::move($2) ; }
484484 | DOLLAR_CURLY expr '}' { $$ = $2; }
485485 ;
486486
0 commit comments