Lexer
- Migrated old noSpaces() function into Lexer::isOneWord.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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&);
|
||||
|
||||
Reference in New Issue
Block a user