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