From 6736546feb419587446f7823e0dd56461f9e11e6 Mon Sep 17 00:00:00 2001
From: Vasileios Karakasis <karakasis@cscs.ch>
Date: Fri, 7 Oct 2016 16:55:27 +0200
Subject: [PATCH] Addresses PR #21 review.

---
 modcc/lexer.hpp            |  3 +--
 tests/modcc/test_lexer.cpp | 11 +++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/modcc/lexer.hpp b/modcc/lexer.hpp
index a998287f..52917e94 100644
--- a/modcc/lexer.hpp
+++ b/modcc/lexer.hpp
@@ -31,7 +31,7 @@ bool is_keyword(Token const& t);
 // takes a range of characters as input parameters
 class Lexer {
 public:
-    Lexer(const char * begin, const char* end)
+    Lexer(const char* begin, const char* end)
     :   begin_(begin),
         end_(end),
         current_(begin),
@@ -114,4 +114,3 @@ protected:
 
     Token token_;
 };
-
diff --git a/tests/modcc/test_lexer.cpp b/tests/modcc/test_lexer.cpp
index dacfe8c6..091a752b 100644
--- a/tests/modcc/test_lexer.cpp
+++ b/tests/modcc/test_lexer.cpp
@@ -205,7 +205,9 @@ TEST(Lexer, braces) {
 
 // test comments
 TEST(Lexer, comments) {
-    char string[] = "foo:this is one line\nbar : another comment\n";
+    char string[] = "foo:this is one line\n"
+                    "bar : another comment\n"
+                    "foobar ? another comment\n";
     PRINT_LEX_STRING
     Lexer lexer(string, string+sizeof(string));
 
@@ -218,7 +220,12 @@ TEST(Lexer, comments) {
     EXPECT_EQ(t2.location.line, 2);
 
     auto t3 = lexer.parse();
-    EXPECT_EQ(t3.type, tok::eof);
+    EXPECT_EQ(t3.type, tok::identifier);
+    EXPECT_EQ(t3.spelling, "foobar");
+    EXPECT_EQ(t3.location.line, 3);
+
+    auto t4 = lexer.parse();
+    EXPECT_EQ(t4.type, tok::eof);
 }
 
 // test numbers
-- 
GitLab