diff --git a/CMakeLists.txt b/CMakeLists.txt index a1e9d65..19fc0a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.12) -project(borr VERSION 1.0.0 LANGUAGES CXX DESCRIPTION "Borr; A simple cross-platform C++ language file parser" HOMEPAGE_URL "https://github.com/SimonCahill") +project(borr VERSION 1.0.1 LANGUAGES CXX DESCRIPTION "Borr; A simple cross-platform C++ language file parser" HOMEPAGE_URL "https://github.com/SimonCahill") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/Doxyfile b/Doxyfile index 321336e..2c21dd7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -78,7 +78,7 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO +INTERNAL_DOCS = YES CASE_SENSE_NAMES = SYSTEM HIDE_SCOPE_NAMES = NO HIDE_COMPOUND_REFERENCE= NO @@ -122,13 +122,13 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = src/language.cpp \ - include/borr/extensions.hpp \ - include/borr/langversion.hpp \ - include/borr/language.hpp \ - include/borr/string_splitter.hpp \ - README.md \ - reference/src/Main.cpp +INPUT = include/borr/language.hpp \ + #include/borr/langversion.hpp \ + #include/borr/extensions.hpp \ + #include/borr/string_splitter.hpp \ + #README.md \ + #src/language.cpp \ + #reference/src/Main.cpp INPUT_ENCODING = UTF-8 INPUT_FILE_ENCODING = FILE_PATTERNS = *.c \ diff --git a/src/language.cpp b/src/language.cpp index 7018f7c..b443c84 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -140,10 +140,11 @@ namespace borr { /** * @brief Determines whether a line is empty or is commented out. * - * @example - * + * + * @code * # this would count as an empty line * [section] # this does not + * @endcode * * @param line The line to check. * @@ -294,7 +295,7 @@ namespace borr { */ string language::removeInlineComments(const string& line) const { namespace rc = std::regex_constants; - static const regex COMMENT_REGEX = regex(R"(#[^\n]+$)", rc::optimize); + static const regex COMMENT_REGEX = regex(R"(#[^\n]+[^"]$)", rc::optimize); string copy = line; smatch matches; diff --git a/test/src/LanguageClassTests.cpp b/test/src/LanguageClassTests.cpp index a683e08..718e906 100644 --- a/test/src/LanguageClassTests.cpp +++ b/test/src/LanguageClassTests.cpp @@ -45,11 +45,13 @@ TEST_F(LanguageClassTests, testRemoveInlineComments) { const static string SECTION_WITH_COMMENT_2 = R"([section]#comment)"; const static string TRANSLATION_WITH_COMMENT = R"(translation = "" # comment)"; const static string TRANSLATION_WITH_COMMENT_2 = R"(translation[] = ""#COMMENTS ARE WEIRD)"; + const static string TRANSLATION_WITH_INTERNAL_COMMENT = R"(translation = "this # shouldn't match")"; ASSERT_EQ(removeInlineComments(SECTION_WITH_COMMENT), R"([section])"); ASSERT_EQ(removeInlineComments(SECTION_WITH_COMMENT_2), R"([section])"); ASSERT_EQ(removeInlineComments(TRANSLATION_WITH_COMMENT), R"(translation = "")"); ASSERT_EQ(removeInlineComments(TRANSLATION_WITH_COMMENT_2), R"(translation[] = "")"); + ASSERT_EQ(removeInlineComments(TRANSLATION_WITH_INTERNAL_COMMENT), TRANSLATION_WITH_INTERNAL_COMMENT); } TEST_F(LanguageClassTests, testIsMultilineField) {