@@ -19,11 +19,7 @@ pub(crate) fn parse_strlen_expression(
19
19
let inner_expression_rule_location = to_query_location ( & inner_expression_rule) ;
20
20
let mut inner_expression = parse_scalar_expression ( inner_expression_rule, scope) ?;
21
21
22
- let inner_expression_value_type_result = inner_expression
23
- . try_resolve_value_type ( & scope. get_pipeline ( ) . get_resolution_scope ( ) )
24
- . map_err ( |e| ParserError :: from ( & e) ) ?;
25
-
26
- if let Some ( v) = inner_expression_value_type_result
22
+ if let Some ( v) = scope. try_resolve_value_type ( & mut inner_expression) ?
27
23
&& v != ValueType :: String
28
24
{
29
25
return Err ( ParserError :: QueryLanguageDiagnostic {
@@ -65,11 +61,7 @@ pub(crate) fn parse_replace_string_expression(
65
61
66
62
let mut scalar = parse_scalar_expression ( rule, scope) ?;
67
63
68
- let scalar_value_type_result = scalar
69
- . try_resolve_value_type ( & scope. get_pipeline ( ) . get_resolution_scope ( ) )
70
- . map_err ( |e| ParserError :: from ( & e) ) ?;
71
-
72
- if let Some ( v) = scalar_value_type_result
64
+ if let Some ( v) = scope. try_resolve_value_type ( & mut scalar) ?
73
65
&& v != ValueType :: String
74
66
{
75
67
return Err ( ParserError :: QueryLanguageDiagnostic {
@@ -96,11 +88,7 @@ pub(crate) fn parse_substring_expression(
96
88
let starting_index_rule_location = to_query_location ( & starting_index_rule) ;
97
89
let mut starting_index_scalar = parse_scalar_expression ( starting_index_rule, scope) ?;
98
90
99
- let starting_index_value_type_result = starting_index_scalar
100
- . try_resolve_value_type ( & scope. get_pipeline ( ) . get_resolution_scope ( ) )
101
- . map_err ( |e| ParserError :: from ( & e) ) ?;
102
-
103
- if let Some ( v) = starting_index_value_type_result
91
+ if let Some ( v) = scope. try_resolve_value_type ( & mut starting_index_scalar) ?
104
92
&& v != ValueType :: Integer
105
93
{
106
94
return Err ( ParserError :: QueryLanguageDiagnostic {
@@ -114,11 +102,7 @@ pub(crate) fn parse_substring_expression(
114
102
let length_scalar_rule_location = to_query_location ( & length_rule) ;
115
103
let mut length_scalar = parse_scalar_expression ( length_rule, scope) ?;
116
104
117
- let length_scalar_value_type_result = length_scalar
118
- . try_resolve_value_type ( & scope. get_pipeline ( ) . get_resolution_scope ( ) )
119
- . map_err ( |e| ParserError :: from ( & e) ) ?;
120
-
121
- if let Some ( v) = length_scalar_value_type_result
105
+ if let Some ( v) = scope. try_resolve_value_type ( & mut length_scalar) ?
122
106
&& v != ValueType :: Integer
123
107
{
124
108
return Err ( ParserError :: QueryLanguageDiagnostic {
@@ -153,9 +137,7 @@ pub(crate) fn parse_parse_json_expression(
153
137
let inner_rule_location = to_query_location ( & inner_rule) ;
154
138
let mut inner_scalar = parse_scalar_expression ( inner_rule, scope) ?;
155
139
156
- if let Some ( v) = inner_scalar
157
- . try_resolve_value_type ( & scope. get_pipeline ( ) . get_resolution_scope ( ) )
158
- . map_err ( |e| ParserError :: from ( & e) ) ?
140
+ if let Some ( v) = scope. try_resolve_value_type ( & mut inner_scalar) ?
159
141
&& v != ValueType :: String
160
142
{
161
143
return Err ( ParserError :: QueryLanguageDiagnostic {
0 commit comments