diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-10 10:36:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-10 10:36:13 +0200 |
commit | 5243f5b2dcfc5608bf7827454e80a16c0ce10329 (patch) | |
tree | 1bdcec13636b298511632c021bbdc3a0269d82fa /tests/lexer/driver.cxx | |
parent | 1b86963946082e10e879283fad51ba7ce4e942e2 (diff) |
Lexer test fixes
Diffstat (limited to 'tests/lexer/driver.cxx')
-rw-r--r-- | tests/lexer/driver.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/lexer/driver.cxx b/tests/lexer/driver.cxx index ca27d39..269a6c1 100644 --- a/tests/lexer/driver.cxx +++ b/tests/lexer/driver.cxx @@ -55,7 +55,7 @@ main () assert (lex ("\\\nfoo") == tokens ({"foo", ""})); assert (lex (" \\ foo") == tokens ({" foo", ""})); assert (lex ("fo\\ o\\:") == tokens ({"fo o:", ""})); - assert (lex ("foo\\\nbar") == tokens ({"foo\nbar", ""})); + assert (lex ("foo\\\nbar") == tokens ({"foobar", ""})); assert (lex ("foo \\\nbar") == tokens ({"foo", "bar", ""})); assert (lex ("\\'foo") == tokens ({"'foo", ""})); @@ -133,7 +133,7 @@ lex (const char* s) { string v; - switch (t.type ()) + switch (t.type) { case token_type::eos: v = ""; break; case token_type::newline: v = "\n"; break; @@ -146,14 +146,14 @@ lex (const char* s) case token_type::dollar: v = "$"; break; case token_type::lparen: v = "("; break; case token_type::rparen: v = ")"; break; - case token_type::name: v = t.name ().c_str (); break; + case token_type::name: v = t.value.c_str (); break; } // cerr << t.line () << ':' << t.column () << ':' << v << endl; r.push_back (move (v)); - if (t.type () == token_type::eos) + if (t.type == token_type::eos) break; } } |