fix special variables in arithmetics

This commit is contained in:
zawz 2021-02-16 15:07:09 +01:00
parent 3b10ce9e52
commit 28e8503b86

View file

@ -427,6 +427,14 @@ std::string subshell_arithmetic::generate(int 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)
{
if(index!=nullptr)
@ -437,6 +445,7 @@ std::string variable::generate(int ind)
return varname;
}
// TEMPLATE
// std::string thing::generate(int ind)