- 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;
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -119,6 +119,7 @@ private:
bool isSubstitution (const std::string&) const;
bool isAttribute (const std::string&) const;
bool isOperator (const std::string&) const;
bool isName (const std::string&) const;
public:
std::multimap <std::string, std::string> _entities;