diff --git a/CMakeLists.txt b/CMakeLists.txt index 09dbdd9..6f0ee68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ endif() target_link_libraries(inja INTERFACE ${INJA_SELECTED_JSON_LIBRARY}) execute_process(COMMAND scripts/update_single_include.sh WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) +# CMake: add_custom_command if(BUILD_TESTING AND INJA_BUILD_TESTS) diff --git a/single_include/inja/inja.hpp b/single_include/inja/inja.hpp index 526f14f..bc82c31 100644 --- a/single_include/inja/inja.hpp +++ b/single_include/inja/inja.hpp @@ -1870,8 +1870,11 @@ class FunctionStorage { if (it == m_map.end()) { return nullptr; } + for (auto &&i: it->second) { - if (i.num_args == num_args) return &i; + if (i.num_args == num_args) { + return &i; + } } return nullptr; } @@ -2215,6 +2218,7 @@ class Lexer { if (std::isalpha(ch)) { return scan_id(); } + switch (ch) { case ',': return make_token(Token::Kind::Comma);