diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-01-22 20:57:54 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-01-22 20:57:54 +0100 |
commit | 3eff766ce1cbed5d3a3c3158614e6741cc1b7f2a (patch) | |
tree | a8151a50baec72bbc81fc8dfcaf476c7f0555693 | |
parent | f4b2027868c9733bbbbcb4c5ec6d5462a8447e5d (diff) |
Using namespace for disambiguation
-rw-r--r-- | lexer.cpp | 2 | ||||
-rw-r--r-- | lexer.h | 4 | ||||
-rw-r--r-- | test-lexer.cpp | 2 |
3 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,7 @@ #include "lexer.h" +using namespace Lex; + void Tree::clear() { nodes.clear(); root = 0; @@ -3,6 +3,8 @@ #include "minicc.h" #include "bnf.h" +namespace Lex { + struct TreeNode { index_t parent{}; std::vector<index_t> childs; // fill char by char @@ -53,4 +55,4 @@ public: }; - +} // namespace Lex diff --git a/test-lexer.cpp b/test-lexer.cpp index 39db3ec..b76f4cc 100644 --- a/test-lexer.cpp +++ b/test-lexer.cpp @@ -76,7 +76,7 @@ TEST_F(Test, BNF) { {"identifier", "XYZ", { 1, 34}}, }; - Lexer lexer(LexBNF, LexTop); + Lex::Lexer lexer(LexBNF, LexTop); auto tokens = lexer.Lex(Code); ASSERT_EQ(tokens, tokens_reference); |