mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
Lexer: ::isLiteral now stops at EOS
This commit is contained in:
parent
f2fe397048
commit
99a53edca0
2 changed files with 4 additions and 3 deletions
|
@ -1271,6 +1271,7 @@ bool Lexer::isLiteral (
|
|||
|
||||
// End boundary conditions must be met.
|
||||
if (endBoundary &&
|
||||
_text[_cursor + common] &&
|
||||
! Lexer::isWhitespace (_text[_cursor + common]) &&
|
||||
! Lexer::isSingleCharOperator (_text[_cursor + common]))
|
||||
return false;
|
||||
|
|
|
@ -272,9 +272,9 @@ int main (int argc, char** argv)
|
|||
t.ok (l4.isLiteral(".", false, false), "isLiteral 'one.two' --> '.'");
|
||||
t.ok (l4.isLiteral("two", false, true), "isLiteral 'one.two' --> 'two'");
|
||||
|
||||
Lexer l5 ("wonderful");
|
||||
t.notok (l5.isLiteral ("wonder", false, false), "isLiteral 'wonder' != 'wonderful' without abbreviation");
|
||||
t.ok (l5.isLiteral ("wonder", true, false), "isLiteral 'wonder' == 'wonderful' with abbreviation");
|
||||
Lexer l5 ("wonder");
|
||||
t.notok (l5.isLiteral ("wonderful", false, false), "isLiteral 'wonderful' != 'wonder' without abbreviation");
|
||||
t.ok (l5.isLiteral ("wonderful", true, false), "isLiteral 'wonderful' == 'wonder' with abbreviation");
|
||||
|
||||
// bool isOneOf (const std::string&, bool, bool);
|
||||
Lexer l6 ("Grumpy.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue