Skip to content

Commit

Permalink
Fixed enum parse issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
refvalue committed Nov 14, 2024
1 parent d351531 commit 144f02a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions include/essence/meta/detail/parse_raw_identifier_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace essence::meta::detail {
* @param raw_name The raw name.
* @return The short identifier name.
*/
consteval std::string_view get_short_identifier_name(std::string_view raw_name) noexcept {
constexpr std::string_view get_short_identifier_name(std::string_view raw_name) noexcept {
return extract_keyword<find_mode_type::full_match_reverse>(
raw_name, language_tokens::scope, extraction_param{.ensure_correctness = false});
}
Expand All @@ -55,7 +55,7 @@ namespace essence::meta::detail {
* @param param The parameter for parsing the identifier.
* @return The remaining part.
*/
consteval std::string_view parse_raw_identifier_name(
constexpr std::string_view parse_raw_identifier_name(
std::string_view prefix, std::string_view signature, const identifier_param& param = {}) noexcept {
#ifdef _MSC_VER
const auto keyword = prefix;
Expand Down
11 changes: 2 additions & 9 deletions include/essence/meta/enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,12 @@ namespace essence::meta {
constexpr auto min = range.first;
constexpr auto max = range.second;

struct dummy {
static constexpr auto copy(std::string_view str) noexcept {
// ReSharper disable once CppDFALocalValueEscapesFunction
return str;
}
};

auto origin = [&]<std::size_t... Is>(std::index_sequence<Is...>) -> generator<std::pair<std::string_view, T>> {
(co_yield std::pair{dummy::copy(get_literal_string_v<T, static_cast<T>(min + Is),
(co_yield std::pair{get_literal_string_v<T, static_cast<T>(min + Is),
identifier_param{
.shortened = Short,
.ensure_correctness = false,
}>()),
}>(),
static_cast<T>(min + Is)},
...);
}(std::make_index_sequence<max - min + 1>{});
Expand Down

0 comments on commit 144f02a

Please sign in to comment.