Skip to content

Commit

Permalink
missing export
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Feb 3, 2024
1 parent 32d06f0 commit 79905ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/c4/yml/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5068,7 +5068,7 @@ FilterResultExtending Parser::filter_scalar_dquoted_in_place(substr dst, size_t
//-----------------------------------------------------------------------------
// block filtering helpers

RYML_EXPORT size_t _find_last_newline_and_larger_indentation(csubstr s, size_t indentation) noexcept
RYML_EXPORT size_t detail::_find_last_newline_and_larger_indentation(csubstr s, size_t indentation) noexcept
{
if(indentation + 1 > s.len)
return npos;
Expand Down Expand Up @@ -5101,7 +5101,7 @@ void Parser::_filter_chomp(FilterProcessor &C4_RESTRICT proc, BlockChomp_e chomp

// advance to the last line having spaces beyond the indentation
{
size_t last = _find_last_newline_and_larger_indentation(proc.rem(), indentation);
size_t last = detail::_find_last_newline_and_larger_indentation(proc.rem(), indentation);
if(last != npos)
{
_c4dbgchomp("found newline and larger indentation. last={}", last);
Expand Down
4 changes: 4 additions & 0 deletions src/c4/yml/parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,10 @@ RYML_DEPRECATED("use parse_in_arena() instead") inline void parse(csubstr filena

/** @} */

namespace detail {
RYML_EXPORT size_t _find_last_newline_and_larger_indentation(csubstr s, size_t indentation) noexcept;
}

} // namespace yml
} // namespace c4

Expand Down
14 changes: 7 additions & 7 deletions test/test_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#else
#include "c4/yml/filter_processor.hpp"
#include "c4/yml/std/string.hpp"
#include "c4/yml/parse.hpp"
#endif
#include <gtest/gtest.h>

Expand Down Expand Up @@ -1447,13 +1448,12 @@ TEST(FilterProcessorSrcDst, translate_esc_extending_bulk_excess)

TEST(Filter, _find_last_newline_and_larger_indentation)
{
RYML_EXPORT size_t _find_last_newline_and_larger_indentation(csubstr s, size_t indentation) noexcept;
EXPECT_EQ(_find_last_newline_and_larger_indentation("ab\n\n\n", 0), npos);
EXPECT_EQ(_find_last_newline_and_larger_indentation("ab\n \n\n", 0), 2u);
EXPECT_EQ(_find_last_newline_and_larger_indentation("ab\n\n \n", 0), 3u);
EXPECT_EQ(_find_last_newline_and_larger_indentation("ab\n \n \n", 0), 4u);
EXPECT_EQ(_find_last_newline_and_larger_indentation("ab\n \n \n", 1), 4u);
EXPECT_EQ(_find_last_newline_and_larger_indentation("ab\n \n \n", 1), 2u);
EXPECT_EQ(detail::_find_last_newline_and_larger_indentation("ab\n\n\n", 0), npos);
EXPECT_EQ(detail::_find_last_newline_and_larger_indentation("ab\n \n\n", 0), 2u);
EXPECT_EQ(detail::_find_last_newline_and_larger_indentation("ab\n\n \n", 0), 3u);
EXPECT_EQ(detail::_find_last_newline_and_larger_indentation("ab\n \n \n", 0), 4u);
EXPECT_EQ(detail::_find_last_newline_and_larger_indentation("ab\n \n \n", 1), 4u);
EXPECT_EQ(detail::_find_last_newline_and_larger_indentation("ab\n \n \n", 1), 2u);
}

} // namespace yml
Expand Down

0 comments on commit 79905ac

Please sign in to comment.