@@ -1242,14 +1242,6 @@ namespace detail {
12421242 substitute_variable
12431243 };
12441244
1245- template <typename Json>
1246- struct expression_context
1247- {
1248- using string_type = std::basic_string<typename Json::char_type>;
1249-
1250- expression_context () = default ;
1251- };
1252-
12531245 template <typename Json>
12541246 class jmespath_evaluator
12551247 {
@@ -3508,7 +3500,6 @@ namespace detail {
35083500 std::error_code& ec)
35093501 {
35103502 static_resources resources{funcs};
3511- std::vector<expression_context<Json>> context_stack;
35123503 std::vector<expr_state> state_stack;
35133504 std::vector<token<Json>> output_stack;
35143505 string_type key_buffer;
@@ -3534,7 +3525,6 @@ namespace detail {
35343525 {
35353526 state_stack.back () = expr_state::rhs_expression;
35363527 state_stack.push_back (expr_state::lhs_expression);
3537- context_stack.push_back (expression_context<Json>{});
35383528 break ;
35393529 }
35403530 case expr_state::rhs_expression:
@@ -3584,16 +3574,12 @@ namespace detail {
35843574 case ' )' :
35853575 {
35863576 state_stack.pop_back ();
3587- JSONCONS_ASSERT (!context_stack.empty ());
3588- context_stack.pop_back ();
35893577 break ;
35903578 }
35913579 default :
35923580 if (state_stack.size () > 1 )
35933581 {
35943582 state_stack.pop_back ();
3595- JSONCONS_ASSERT (!context_stack.empty ());
3596- context_stack.pop_back ();
35973583 }
35983584 else
35993585 {
@@ -3698,7 +3684,6 @@ namespace detail {
36983684 state_stack.back () = expr_state::expect_rparen;
36993685 state_stack.push_back (expr_state::rhs_expression);
37003686 state_stack.push_back (expr_state::lhs_expression);
3701- context_stack.push_back (expression_context<Json>{});
37023687 break ;
37033688 }
37043689 case ' !' :
@@ -3824,7 +3809,6 @@ namespace detail {
38243809 state_stack.push_back (expr_state::expression_type);
38253810 state_stack.push_back (expr_state::rhs_expression);
38263811 state_stack.push_back (expr_state::lhs_expression);
3827- context_stack.push_back (expression_context<Json>{});
38283812 ++p_;
38293813 ++column_;
38303814 break ;
@@ -3833,7 +3817,6 @@ namespace detail {
38333817 if (JSONCONS_UNLIKELY (ec)) {return jmespath_expression{};}
38343818 state_stack.push_back (expr_state::rhs_expression);
38353819 state_stack.push_back (expr_state::lhs_expression);
3836- context_stack.push_back (expression_context<Json>{});
38373820 break ;
38383821 }
38393822 break ;
@@ -3881,7 +3864,6 @@ namespace detail {
38813864 state_stack.back () = expr_state::expect_in_or_comma;
38823865 state_stack.push_back (expr_state::rhs_expression);
38833866 state_stack.push_back (expr_state::lhs_expression);
3884- context_stack.push_back (expression_context<Json>{});
38853867 break ;
38863868 }
38873869 default :
@@ -4394,7 +4376,6 @@ namespace detail {
43944376 state_stack.back () = expr_state::filter;
43954377 state_stack.push_back (expr_state::rhs_expression);
43964378 state_stack.push_back (expr_state::lhs_expression);
4397- context_stack.push_back (expression_context<Json>{});
43984379 ++p_;
43994380 ++column_;
44004381 break ;
@@ -4434,7 +4415,6 @@ namespace detail {
44344415 state_stack.back () = expr_state::multi_select_list;
44354416 state_stack.push_back (expr_state::rhs_expression);
44364417 state_stack.push_back (expr_state::lhs_expression);
4437- context_stack.push_back (expression_context<Json>{});
44384418 }
44394419 break ;
44404420 case ' ]' : // []
@@ -4449,7 +4429,6 @@ namespace detail {
44494429 state_stack.back () = expr_state::multi_select_list;
44504430 state_stack.push_back (expr_state::rhs_expression);
44514431 state_stack.push_back (expr_state::lhs_expression);
4452- context_stack.push_back (expression_context<Json>{});
44534432 break ;
44544433 }
44554434 break ;
@@ -4476,7 +4455,6 @@ namespace detail {
44764455 state_stack.back () = expr_state::multi_select_list;
44774456 state_stack.push_back (expr_state::rhs_expression);
44784457 state_stack.push_back (expr_state::lhs_expression);
4479- context_stack.push_back (expression_context<Json>{});
44804458 break ;
44814459 }
44824460 break ;
@@ -4837,7 +4815,6 @@ namespace detail {
48374815 advance_past_space_character ();
48384816 break ;
48394817 case ' ,' :
4840- JSONCONS_ASSERT (!context_stack.empty ());
48414818 push_token (token<Json>(separator_arg), resources, output_stack, ec);
48424819 if (JSONCONS_UNLIKELY (ec)) {return jmespath_expression{};}
48434820 state_stack.push_back (expr_state::lhs_expression);
@@ -4937,7 +4914,6 @@ namespace detail {
49374914 case ' :' :
49384915 state_stack.back () = expr_state::rhs_expression;
49394916 state_stack.push_back (expr_state::lhs_expression);
4940- context_stack.push_back (expression_context<Json>{});
49414917 ++p_;
49424918 ++column_;
49434919 break ;
@@ -4962,8 +4938,6 @@ namespace detail {
49624938 {
49634939 case expr_state::rhs_expression:
49644940 state_stack.pop_back ();
4965- JSONCONS_ASSERT (!context_stack.empty ());
4966- context_stack.pop_back ();
49674941 break ;
49684942 case expr_state::substitute_variable:
49694943 {
@@ -5004,14 +4978,10 @@ namespace detail {
50044978 }
50054979
50064980 state_stack.pop_back ();
5007- JSONCONS_ASSERT (!context_stack.empty ());
5008- context_stack.pop_back ();
50094981
50104982 push_token (end_of_expression_arg, resources, output_stack, ec);
50114983 if (JSONCONS_UNLIKELY (ec)) {return jmespath_expression{};}
50124984
5013- JSONCONS_ASSERT (context_stack.empty ());
5014-
50154985 if (output_stack.front ().type () != token_kind::literal)
50164986 {
50174987 output_stack.insert (output_stack.begin (), token<Json>{current_node_arg});
0 commit comments