@@ -310,7 +310,7 @@ void ExprVar::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
310
310
const StaticEnv * curEnv;
311
311
Level level;
312
312
int withLevel = -1 ;
313
- for (curEnv = env.get (), level = 0 ; curEnv; curEnv = curEnv->up , level++) {
313
+ for (curEnv = env.get (), level = 0 ; curEnv; curEnv = curEnv->up . get () , level++) {
314
314
if (curEnv->isWith ) {
315
315
if (withLevel == -1 ) withLevel = level;
316
316
} else {
@@ -331,7 +331,7 @@ void ExprVar::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
331
331
" undefined variable '%1%'" ,
332
332
es.symbols [name]
333
333
).atPos (pos).debugThrow ();
334
- for (auto * e = env.get (); e && !fromWith; e = e->up )
334
+ for (auto * e = env.get (); e && !fromWith; e = e->up . get () )
335
335
fromWith = e->isWith ;
336
336
this ->level = withLevel;
337
337
}
@@ -379,7 +379,7 @@ std::shared_ptr<const StaticEnv> ExprAttrs::bindInheritSources(
379
379
// and displacement, and nothing else is allowed to access it. ideally we'd
380
380
// not even *have* an expr that grabs anything from this env since it's fully
381
381
// invisible, but the evaluator does not allow for this yet.
382
- auto inner = std::make_shared<StaticEnv>(nullptr , env. get () , 0 );
382
+ auto inner = std::make_shared<StaticEnv>(nullptr , env, 0 );
383
383
for (auto from : *inheritFromExprs)
384
384
from->bindVars (es, env);
385
385
@@ -393,7 +393,7 @@ void ExprAttrs::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv>
393
393
394
394
if (recursive) {
395
395
auto newEnv = [&] () -> std::shared_ptr<const StaticEnv> {
396
- auto newEnv = std::make_shared<StaticEnv>(nullptr , env. get () , attrs.size ());
396
+ auto newEnv = std::make_shared<StaticEnv>(nullptr , env, attrs.size ());
397
397
398
398
Displacement displ = 0 ;
399
399
for (auto & i : attrs)
@@ -440,7 +440,7 @@ void ExprLambda::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv>
440
440
es.exprEnvs .insert (std::make_pair (this , env));
441
441
442
442
auto newEnv = std::make_shared<StaticEnv>(
443
- nullptr , env. get () ,
443
+ nullptr , env,
444
444
(hasFormals () ? formals->formals .size () : 0 ) +
445
445
(!arg ? 0 : 1 ));
446
446
@@ -474,7 +474,7 @@ void ExprCall::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
474
474
void ExprLet::bindVars (EvalState & es, const std::shared_ptr<const StaticEnv> & env)
475
475
{
476
476
auto newEnv = [&] () -> std::shared_ptr<const StaticEnv> {
477
- auto newEnv = std::make_shared<StaticEnv>(nullptr , env. get () , attrs->attrs .size ());
477
+ auto newEnv = std::make_shared<StaticEnv>(nullptr , env, attrs->attrs .size ());
478
478
479
479
Displacement displ = 0 ;
480
480
for (auto & i : attrs->attrs )
@@ -500,7 +500,7 @@ void ExprWith::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
500
500
es.exprEnvs .insert (std::make_pair (this , env));
501
501
502
502
parentWith = nullptr ;
503
- for (auto * e = env.get (); e && !parentWith; e = e->up )
503
+ for (auto * e = env.get (); e && !parentWith; e = e->up . get () )
504
504
parentWith = e->isWith ;
505
505
506
506
/* Does this `with' have an enclosing `with'? If so, record its
@@ -509,14 +509,14 @@ void ExprWith::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
509
509
const StaticEnv * curEnv;
510
510
Level level;
511
511
prevWith = 0 ;
512
- for (curEnv = env.get (), level = 1 ; curEnv; curEnv = curEnv->up , level++)
512
+ for (curEnv = env.get (), level = 1 ; curEnv; curEnv = curEnv->up . get () , level++)
513
513
if (curEnv->isWith ) {
514
514
prevWith = level;
515
515
break ;
516
516
}
517
517
518
518
attrs->bindVars (es, env);
519
- auto newEnv = std::make_shared<StaticEnv>(this , env. get () );
519
+ auto newEnv = std::make_shared<StaticEnv>(this , env);
520
520
body->bindVars (es, newEnv);
521
521
}
522
522
0 commit comments