Don't consider empty strings or strings beginning with numbers as variable names.
This commit is contained in:
parent
2111098a3a
commit
f30fd9c47b
1 changed files with 3 additions and 2 deletions
|
@ -250,8 +250,9 @@ static int runProgram(const string & program, const Strings & args)
|
|||
|
||||
bool isVarName(const string & s)
|
||||
{
|
||||
if (s.size() > 0 && (s[0] == '-' || s[0] == '\''))
|
||||
return false;
|
||||
if (s.size() == 0) return false;
|
||||
char c = s[0];
|
||||
if ((c >= '0' && c <= '9') || c == '-' || c == '\'') return false;
|
||||
for (auto & i : s)
|
||||
if (!((i >= 'a' && i <= 'z') ||
|
||||
(i >= 'A' && i <= 'Z') ||
|
||||
|
|
Loading…
Reference in a new issue