Changes in src/Tuples/TupleAssignment.cc [3251b66:07de76b]
- File:
-
- 1 edited
-
src/Tuples/TupleAssignment.cc (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/TupleAssignment.cc
r3251b66 r07de76b 465 465 // resolve ctor/dtor for the new object 466 466 ast::ptr< ast::Init > ctorInit = ResolvExpr::resolveCtorInit( 467 InitTweak::genCtorInit( location, ret ), spotter.crntFinder. localSyms);467 InitTweak::genCtorInit( location, ret ), spotter.crntFinder.symtab ); 468 468 // remove environments from subexpressions of stmtExpr 469 469 ast::Pass< EnvRemover > rm{ env }; … … 504 504 505 505 std::vector< ast::ptr< ast::Expr > > match() override { 506 // temporary workaround for new and old ast to coexist and avoid name collision 507 static UniqueName lhsNamer( "__massassign_Ln" ); 508 static UniqueName rhsNamer( "__massassign_Rn" ); 506 static UniqueName lhsNamer( "__massassign_L" ); 507 static UniqueName rhsNamer( "__massassign_R" ); 509 508 // empty tuple case falls into this matcher 510 509 assert( lhs.empty() ? rhs.empty() : rhs.size() <= 1 ); … … 535 534 536 535 std::vector< ast::ptr< ast::Expr > > match() override { 537 // temporary workaround for new and old ast to coexist and avoid name collision 538 static UniqueName lhsNamer( "__multassign_Ln" ); 539 static UniqueName rhsNamer( "__multassign_Rn" ); 536 static UniqueName lhsNamer( "__multassign_L" ); 537 static UniqueName rhsNamer( "__multassign_R" ); 540 538 541 539 if ( lhs.size() != rhs.size() ) return {}; … … 562 560 // resolve the cast expression so that rhsCand return type is bound by the cast 563 561 // type as needed, and transfer the resulting environment 564 ResolvExpr::CandidateFinder finder{ spotter.crntFinder. localSyms, env };562 ResolvExpr::CandidateFinder finder{ spotter.crntFinder.symtab, env }; 565 563 finder.find( rhsCand->expr, ResolvExpr::ResolvMode::withAdjustment() ); 566 564 assert( finder.candidates.size() == 1 ); … … 611 609 // explode the LHS so that each field of a tuple-valued expr is assigned 612 610 ResolvExpr::CandidateList lhs; 613 explode( *lhsCand, crntFinder. localSyms, back_inserter(lhs), true );611 explode( *lhsCand, crntFinder.symtab, back_inserter(lhs), true ); 614 612 for ( ResolvExpr::CandidateRef & cand : lhs ) { 615 613 // each LHS value must be a reference - some come in with a cast, if not … … 631 629 if ( isTuple( rhsCand->expr ) ) { 632 630 // multiple assignment 633 explode( *rhsCand, crntFinder. localSyms, back_inserter(rhs), true );631 explode( *rhsCand, crntFinder.symtab, back_inserter(rhs), true ); 634 632 matcher.reset( 635 633 new MultipleAssignMatcher{ *this, expr->location, lhs, rhs } ); … … 650 648 // multiple assignment 651 649 ResolvExpr::CandidateList rhs; 652 explode( rhsCand, crntFinder. localSyms, back_inserter(rhs), true );650 explode( rhsCand, crntFinder.symtab, back_inserter(rhs), true ); 653 651 matcher.reset( 654 652 new MultipleAssignMatcher{ *this, expr->location, lhs, rhs } ); … … 680 678 ) 681 679 682 ResolvExpr::CandidateFinder finder{ crntFinder. localSyms, matcher->env };680 ResolvExpr::CandidateFinder finder{ crntFinder.symtab, matcher->env }; 683 681 684 682 try {
Note:
See TracChangeset
for help on using the changeset viewer.