diff --git a/src/coders/lua_parsing.cpp b/src/coders/syntax_parser.cpp similarity index 97% rename from src/coders/lua_parsing.cpp rename to src/coders/syntax_parser.cpp index 0840c369..fb26f622 100644 --- a/src/coders/lua_parsing.cpp +++ b/src/coders/syntax_parser.cpp @@ -1,10 +1,9 @@ -#include "lua_parsing.hpp" +#include "syntax_parser.hpp" #include #include "BasicParser.hpp" -using namespace lua; using namespace devtools; static std::set keywords { @@ -188,6 +187,8 @@ public: } }; -std::vector lua::tokenize(std::string_view file, std::wstring_view source) { +std::vector devtools::tokenize( + std::string_view file, std::wstring_view source +) { return Tokenizer(file, source).tokenize(); } diff --git a/src/coders/lua_parsing.hpp b/src/coders/syntax_parser.hpp similarity index 71% rename from src/coders/lua_parsing.hpp rename to src/coders/syntax_parser.hpp index 2d5e6349..d8166a0a 100644 --- a/src/coders/lua_parsing.hpp +++ b/src/coders/syntax_parser.hpp @@ -5,8 +5,8 @@ #include "devtools/syntax.hpp" -namespace lua { - std::vector tokenize( +namespace devtools { + std::vector tokenize( std::string_view file, std::wstring_view source ); } diff --git a/src/devtools/syntax_highlighting.cpp b/src/devtools/syntax_highlighting.cpp index 7aa95a23..748f9aaa 100644 --- a/src/devtools/syntax_highlighting.cpp +++ b/src/devtools/syntax_highlighting.cpp @@ -1,7 +1,7 @@ #include "syntax_highlighting.hpp" #include "coders/commons.hpp" -#include "coders/lua_parsing.hpp" +#include "coders/syntax_parser.hpp" #include "graphics/core/Font.hpp" using namespace devtools; @@ -60,7 +60,7 @@ std::unique_ptr devtools::syntax_highlight( ) { try { if (lang == "lua") { - auto tokens = lua::tokenize("", source); + auto tokens = tokenize("", source); return build_styles(tokens); } else { return nullptr; diff --git a/test/coders/lua_parsing.cpp b/test/coders/lua_parsing.cpp index dcfaeffc..2bc547c4 100644 --- a/test/coders/lua_parsing.cpp +++ b/test/coders/lua_parsing.cpp @@ -1,4 +1,4 @@ -#include "coders/lua_parsing.hpp" +#include "coders/syntax_parser.hpp" #include @@ -14,7 +14,7 @@ TEST(lua_parsing, Tokenizer) { auto filename = "res:scripts/stdlib.lua"; auto source = io::read_string(filename); try { - auto tokens = lua::tokenize(filename, util::str2wstr_utf8(source)); + auto tokens = devtools::tokenize(filename, util::str2wstr_utf8(source)); for (const auto& token : tokens) { std::cout << (int)token.tag << " " << util::quote(util::wstr2str_utf8(token.text))