Skip to content

Commit

Permalink
fix: C1001
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Mar 20, 2024
1 parent 9cbc50a commit 2a0b3fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/parser/location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ struct location_info
range _self;
std::variant<std::monostate, parse_array_info, parse_object_info> _info;

bool is_arr() const { return _info.index() == 1; }

bool is_obj() const { return _info.index() == 2; }

parse_array_info& arr() { return std::get<1>(_info); }

const parse_array_info& arr() const { return std::get<1>(_info); }
Expand Down Expand Up @@ -243,7 +247,7 @@ inline void location_info_generator<string_t>::object_enter(
std::ignore = path;

before_value();
cur()._info = location_info<string_t>::parse_object_info {};
cur()._info = typename location_info<string_t>::parse_object_info {};
}

template <typename string_t>
Expand All @@ -267,7 +271,7 @@ inline void location_info_generator<string_t>::array_enter(
std::ignore = path;

before_value();
cur()._info = location_info<string_t>::parse_array_info {};
cur()._info = typename location_info<string_t>::parse_array_info {};
}

template <typename string_t>
Expand Down

0 comments on commit 2a0b3fd

Please sign in to comment.