From 2a0b3fd628f0dddf078d584417dc661263309c9d Mon Sep 17 00:00:00 2001 From: nekosu Date: Wed, 20 Mar 2024 00:40:22 +0800 Subject: [PATCH] fix: C1001 --- include/parser/location.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/parser/location.hpp b/include/parser/location.hpp index 003d824..df6d032 100644 --- a/include/parser/location.hpp +++ b/include/parser/location.hpp @@ -59,6 +59,10 @@ struct location_info range _self; std::variant _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); } @@ -243,7 +247,7 @@ inline void location_info_generator::object_enter( std::ignore = path; before_value(); - cur()._info = location_info::parse_object_info {}; + cur()._info = typename location_info::parse_object_info {}; } template @@ -267,7 +271,7 @@ inline void location_info_generator::array_enter( std::ignore = path; before_value(); - cur()._info = location_info::parse_array_info {}; + cur()._info = typename location_info::parse_array_info {}; } template