From 5243f5b2dcfc5608bf7827454e80a16c0ce10329 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Sep 2015 10:36:13 +0200 Subject: Lexer test fixes --- tests/lexer/driver.cxx | 8 ++++---- 1 file 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; } } -- cgit v1.1