mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 22:47:20 +02:00
Lexer: ::readWord now skips leading whiteSpace
This commit is contained in:
parent
6c56f4b695
commit
e55528e21e
2 changed files with 11 additions and 4 deletions
|
@ -1324,16 +1324,18 @@ bool Lexer::readWord (
|
|||
{
|
||||
std::string::size_type eos = text.length ();
|
||||
|
||||
// Skip initial whitespace.
|
||||
while (cursor <= eos &&
|
||||
Lexer::isWhitespace(text[cursor]))
|
||||
++cursor;
|
||||
|
||||
word = "";
|
||||
int c;
|
||||
while ((c = text[cursor]))
|
||||
{
|
||||
// Unquoted word ends on white space.
|
||||
if (Lexer::isWhitespace (c))
|
||||
{
|
||||
++cursor;
|
||||
break;
|
||||
}
|
||||
|
||||
// Unicode U+XXXX or \uXXXX codepoint.
|
||||
else if (eos - cursor >= 6 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue