fix special variables in arithmetics
This commit is contained in:
parent
3b10ce9e52
commit
28e8503b86
1 changed files with 11 additions and 2 deletions
|
|
@ -427,6 +427,14 @@ std::string subshell_arithmetic::generate(int ind)
|
||||||
return '$' + sbsh->generate(ind);
|
return '$' + sbsh->generate(ind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string variable_arithmetic::generate(int ind)
|
||||||
|
{
|
||||||
|
std::string ret=var->generate(ind);
|
||||||
|
if(is_num(ret[0]) || is_in(ret[0], SPECIAL_VARS))
|
||||||
|
return '$' + ret;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
std::string variable::generate(int ind)
|
std::string variable::generate(int ind)
|
||||||
{
|
{
|
||||||
if(index!=nullptr)
|
if(index!=nullptr)
|
||||||
|
|
@ -437,6 +445,7 @@ std::string variable::generate(int ind)
|
||||||
return varname;
|
return varname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TEMPLATE
|
// TEMPLATE
|
||||||
|
|
||||||
// std::string thing::generate(int ind)
|
// std::string thing::generate(int ind)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue