mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lexer: Corrected off-by-one error in ::isTripleCharOperator
This commit is contained in:
parent
71fea510bb
commit
96c448ca1e
1 changed files with 4 additions and 1 deletions
|
@ -275,6 +275,9 @@ bool Lexer::isTripleCharOperator (int c0, int c1, int c2, int c3)
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool Lexer::isBoundary (int left, int right)
|
bool Lexer::isBoundary (int left, int right)
|
||||||
{
|
{
|
||||||
|
// EOS
|
||||||
|
if (right == '\0') return true;
|
||||||
|
|
||||||
// XOR
|
// XOR
|
||||||
if (isalpha (left) != isalpha (right)) return true;
|
if (isalpha (left) != isalpha (right)) return true;
|
||||||
if (isDigit (left) != isDigit (right)) return true;
|
if (isDigit (left) != isDigit (right)) return true;
|
||||||
|
@ -928,7 +931,7 @@ bool Lexer::isOperator (std::string& token, Lexer::Type& type)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (_eos - marker >= 4 &&
|
else if (_eos - marker >= 3 &&
|
||||||
isTripleCharOperator (_text[marker], _text[marker + 1], _text[marker + 2], _text[marker + 3]))
|
isTripleCharOperator (_text[marker], _text[marker + 1], _text[marker + 2], _text[marker + 3]))
|
||||||
{
|
{
|
||||||
marker += 3;
|
marker += 3;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue