- Implemented ::isName.
This commit is contained in:
Paul Beckingham 2014-11-04 22:53:12 -05:00
parent 38359b779a
commit 39983e5f82
2 changed files with 20 additions and 0 deletions

View file

@ -2248,3 +2248,22 @@ bool CLI::isOperator (const std::string& raw) const
}
////////////////////////////////////////////////////////////////////////////////
bool CLI::isName (const std::string& raw) const
{
if (raw != "")
{
for (int i = 0; i < raw.length (); ++i)
{
if (i == 0 && ! Lexer::is_ident_start (raw[i]))
return false;
else if (! Lexer::is_ident (raw[i]))
return false;
}
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////