mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CLI
- Implemented ::isName.
This commit is contained in:
parent
38359b779a
commit
39983e5f82
2 changed files with 20 additions and 0 deletions
19
src/CLI.cpp
19
src/CLI.cpp
|
@ -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;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue