* Refactoring: move variable uses to a separate class.
This commit is contained in:
parent
110d155778
commit
81de12bc8f
4 changed files with 31 additions and 35 deletions
|
|
@ -38,7 +38,7 @@ void ExprPath::show(std::ostream & str)
|
|||
|
||||
void ExprVar::show(std::ostream & str)
|
||||
{
|
||||
str << name;
|
||||
str << info.name;
|
||||
}
|
||||
|
||||
void ExprSelect::show(std::ostream & str)
|
||||
|
|
@ -157,7 +157,7 @@ void ExprPath::bindVars(const StaticEnv & env)
|
|||
{
|
||||
}
|
||||
|
||||
void ExprVar::bindVars(const StaticEnv & env)
|
||||
void VarRef::bind(const StaticEnv & env)
|
||||
{
|
||||
/* Check whether the variable appears in the environment. If so,
|
||||
set its level and displacement. */
|
||||
|
|
@ -187,6 +187,11 @@ void ExprVar::bindVars(const StaticEnv & env)
|
|||
this->level = withLevel;
|
||||
}
|
||||
|
||||
void ExprVar::bindVars(const StaticEnv & env)
|
||||
{
|
||||
info.bind(env);
|
||||
}
|
||||
|
||||
void ExprSelect::bindVars(const StaticEnv & env)
|
||||
{
|
||||
e->bindVars(env);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue