Lexer: ::readWord now skips leading whiteSpace
This commit is contained in:
@@ -37,7 +37,7 @@ Context context;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (1067);
|
||||
UnitTest t (1069);
|
||||
|
||||
std::vector <std::pair <std::string, Lexer::Type>> tokens;
|
||||
std::string token;
|
||||
@@ -248,6 +248,11 @@ int main (int argc, char** argv)
|
||||
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one 'two' three\\ four\" --> true");
|
||||
t.is (word, "three four", " word '" + word + "'");
|
||||
|
||||
text = "one ";
|
||||
cursor = 0;
|
||||
t.ok (Lexer::readWord (text, cursor, word), "readWord \"one \" --> true");
|
||||
t.is (word, "one", " word '" + word + "'");
|
||||
|
||||
// Test all Lexer types.
|
||||
#define NO {"",Lexer::Type::word}
|
||||
struct
|
||||
|
||||
Reference in New Issue
Block a user