mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 00:57:19 +02:00
Lexer: Added 'endBoundary' requirement to ::isUUID
This commit is contained in:
parent
f910ce39de
commit
3e74aa51e2
2 changed files with 8 additions and 7 deletions
|
@ -79,7 +79,7 @@ bool Lexer::token (std::string& token, Lexer::Type& type)
|
|||
isDuration (token, type) ||
|
||||
isURL (token, type) ||
|
||||
isPair (token, type) ||
|
||||
isUUID (token, type) ||
|
||||
isUUID (token, type, true) ||
|
||||
isSet (token, type) ||
|
||||
isDOM (token, type) ||
|
||||
isHexNumber (token, type) ||
|
||||
|
@ -471,7 +471,7 @@ bool Lexer::isDuration (std::string& token, Lexer::Type& type)
|
|||
// XXXXXXXX-
|
||||
// XXXXXXXX
|
||||
// Followed only by EOS, whitespace, or single character operator.
|
||||
bool Lexer::isUUID (std::string& token, Lexer::Type& type)
|
||||
bool Lexer::isUUID (std::string& token, Lexer::Type& type, bool endBoundary)
|
||||
{
|
||||
std::size_t marker = _cursor;
|
||||
|
||||
|
@ -487,10 +487,11 @@ bool Lexer::isUUID (std::string& token, Lexer::Type& type)
|
|||
break;
|
||||
}
|
||||
|
||||
if (i >= uuid_min_length &&
|
||||
(_text[marker + i] == 0 ||
|
||||
isWhitespace (_text[marker + i]) ||
|
||||
isSingleCharOperator (_text[marker + i])))
|
||||
if (! endBoundary ||
|
||||
(i >= uuid_min_length &&
|
||||
(_text[marker + i] == 0 ||
|
||||
isWhitespace (_text[marker + i]) ||
|
||||
isSingleCharOperator (_text[marker + i]))))
|
||||
{
|
||||
token = _text.substr (_cursor, i);
|
||||
if (! isAllDigits (token))
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
bool isString (std::string&, Lexer::Type&, const std::string&);
|
||||
bool isDate (std::string&, Lexer::Type&);
|
||||
bool isDuration (std::string&, Lexer::Type&);
|
||||
bool isUUID (std::string&, Lexer::Type&);
|
||||
bool isUUID (std::string&, Lexer::Type&, bool);
|
||||
bool isNumber (std::string&, Lexer::Type&);
|
||||
bool isInteger (std::string&, Lexer::Type&);
|
||||
bool isHexNumber (std::string&, Lexer::Type&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue