- Migrated old noSpaces() function into Lexer::isOneWord.
This commit is contained in:
Paul Beckingham 2015-02-22 18:23:26 -05:00
parent 745aad0d27
commit 8791c0a921
2 changed files with 13 additions and 0 deletions

View file

@ -999,3 +999,15 @@ bool Lexer::isAllDigits (const std::string& text)
}
////////////////////////////////////////////////////////////////////////////////
bool Lexer::isOneWord (const std::string& text)
{
std::string::size_type i = 0;
int character;
while ((character = utf8_next_char (text, i)))
if (Lexer::isWhitespace (character))
return false;
return true;
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -59,6 +59,7 @@ public:
static std::vector <std::string> split (const std::string&);
static std::string typeToString (Lexer::Type);
static bool isAllDigits (const std::string&);
static bool isOneWord (const std::string&);
// Static helpers.
static const std::string typeName (const Lexer::Type&);