mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lexer
- Migrated old noSpaces() function into Lexer::isOneWord.
This commit is contained in:
parent
745aad0d27
commit
8791c0a921
2 changed files with 13 additions and 0 deletions
|
@ -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&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue