mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Lexer: Skipping whitespace on ::readWord at SOL was a mistake
This commit is contained in:
parent
29486144c9
commit
45aaa530ac
2 changed files with 2 additions and 5 deletions
|
@ -1324,11 +1324,6 @@ bool Lexer::readWord (
|
||||||
{
|
{
|
||||||
std::string::size_type eos = text.length ();
|
std::string::size_type eos = text.length ();
|
||||||
|
|
||||||
// Skip initial whitespace.
|
|
||||||
while (cursor <= eos &&
|
|
||||||
Lexer::isWhitespace(text[cursor]))
|
|
||||||
++cursor;
|
|
||||||
|
|
||||||
word = "";
|
word = "";
|
||||||
int c;
|
int c;
|
||||||
while ((c = text[cursor]))
|
while ((c = text[cursor]))
|
||||||
|
|
|
@ -243,8 +243,10 @@ int main (int argc, char** argv)
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one 'two' three\\ four\" --> true");
|
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one 'two' three\\ four\" --> true");
|
||||||
t.is (word, "one", " word '" + word + "'");
|
t.is (word, "one", " word '" + word + "'");
|
||||||
|
cursor++;
|
||||||
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one 'two' three\\ four\" --> true");
|
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one 'two' three\\ four\" --> true");
|
||||||
t.is (word, "'two'", " word '" + word + "'");
|
t.is (word, "'two'", " word '" + word + "'");
|
||||||
|
cursor++;
|
||||||
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one 'two' three\\ four\" --> true");
|
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one 'two' three\\ four\" --> true");
|
||||||
t.is (word, "three four", " word '" + word + "'");
|
t.is (word, "three four", " word '" + word + "'");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue