aboutsummaryrefslogtreecommitdiff
path: root/src/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/context.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/context.cpp b/src/context.cpp
index e9330e5..efe8098 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -144,13 +144,20 @@ void Context::pushScope()
144 144
145void Context::pushScope( const VarHash &hNewVars ) 145void Context::pushScope( const VarHash &hNewVars )
146{ 146{
147// sio << "Pushing scope, merging contexts." << sio.nl << sio.nl;
147 VarHash h = hNewVars; 148 VarHash h = hNewVars;
148 if( !sVars.isEmpty() ) 149 if( !sVars.isEmpty() )
149 { 150 {
151// sio << "hNewVars = " << h << sio.nl << sio.nl
152// << "sVars = " << sVars.peek() << sio.nl;
150 for( VarHash::iterator i = sVars.peek().begin(); i; i++ ) 153 for( VarHash::iterator i = sVars.peek().begin(); i; i++ )
151 { 154 {
155// sio << "Checking '" << i.getKey() << "' (" << i.getValue() << ")." << sio.nl;
152 if( !h.has( i.getKey() ) ) 156 if( !h.has( i.getKey() ) )
157 {
158// sio << " Context doesn't have '" << i.getKey() << "' adding... '" << i.getValue() << "'." << sio.nl;
153 h.insert( i.getKey(), i.getValue() ); 159 h.insert( i.getKey(), i.getValue() );
160 }
154 } 161 }
155 } 162 }
156 sVars.push( h ); 163 sVars.push( h );
@@ -158,7 +165,7 @@ void Context::pushScope( const VarHash &hNewVars )
158 165
159VarHash &Context::getScope() 166VarHash &Context::getScope()
160{ 167{
161 return sVars.first(); 168 return sVars.peek();
162} 169}
163 170
164void Context::popScope() 171void Context::popScope()
@@ -344,14 +351,14 @@ void Context::buildTargetTree( Runner &r )
344 } 351 }
345} 352}
346 353
347void Context::buildTargetTree( class Runner &r, class Target * /*pTarget*/, const Bu::FString &sInput, Rule *pMaster, StrList &lNewIns ) 354void Context::buildTargetTree( class Runner &r, class Target *pTarget, const Bu::FString &sInput, Rule *pMaster, StrList &lNewIns )
348{ 355{
349 Target *pNewTarget = NULL; 356 Target *pNewTarget = NULL;
350 for( RuleHash::iterator i = hRule.begin(); i; i++ ) 357 for( RuleHash::iterator i = hRule.begin(); i; i++ )
351 { 358 {
352 if( (*i)->hasOutputs() && (*i)->ruleMatches( r, sInput ) ) 359 if( (*i)->hasOutputs() && (*i)->ruleMatches( r, sInput ) )
353 { 360 {
354 pNewTarget = (*i)->createTarget( r, sInput ); 361 pNewTarget = (*i)->createTarget( r, sInput, pTarget );
355 362
356 Bu::Hash<ptrdiff_t, bool> hDone; 363 Bu::Hash<ptrdiff_t, bool> hDone;
357 for( StrList::const_iterator oi = 364 for( StrList::const_iterator oi =