@@ -8,13 +8,16 @@ use gitql_core::values::Value;
88use crate :: functions:: matcher_signature_without_parameters;
99use crate :: ir:: types:: InstMatcherType ;
1010use crate :: ir:: values:: InstMatcherValue ;
11+ use crate :: matchers:: constants:: ConstExprMatcher ;
1112use crate :: matchers:: constants:: ConstFloatMatcher ;
1213use crate :: matchers:: constants:: ConstIntMatcher ;
1314use crate :: matchers:: constants:: ConstNumberMatcher ;
1415use crate :: matchers:: constants:: ConstPointerNullMatcher ;
1516
1617#[ inline( always) ]
1718pub fn register_constants_matchers_functions ( map : & mut HashMap < & ' static str , StandardFunction > ) {
19+ map. insert ( "m_const_expr" , match_const_expr_inst) ;
20+
1821 map. insert ( "m_const_num" , match_const_num_inst) ;
1922 map. insert ( "m_const_int" , match_const_int_inst) ;
2023 map. insert ( "m_zero" , match_const_zero_inst) ;
@@ -29,6 +32,7 @@ pub fn register_constants_matchers_functions(map: &mut HashMap<&'static str, Sta
2932
3033#[ inline( always) ]
3134pub fn register_constants_matchers_function_signatures ( map : & mut HashMap < & ' static str , Signature > ) {
35+ map. insert ( "m_const_expr" , matcher_signature_without_parameters ( ) ) ;
3236 map. insert ( "m_const_num" , matcher_signature_without_parameters ( ) ) ;
3337 map. insert ( "m_const_int" , matcher_signature_without_parameters ( ) ) ;
3438 map. insert ( "m_zero" , matcher_signature_without_parameters ( ) ) ;
@@ -54,6 +58,11 @@ pub fn register_constants_matchers_function_signatures(map: &mut HashMap<&'stati
5458 map. insert ( "m_const_null" , matcher_signature_without_parameters ( ) ) ;
5559}
5660
61+ fn match_const_expr_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
62+ let matcher = Box :: new ( ConstExprMatcher ) ;
63+ Box :: new ( InstMatcherValue { matcher } )
64+ }
65+
5766fn match_const_num_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
5867 let matcher = Box :: new ( ConstNumberMatcher ) ;
5968 Box :: new ( InstMatcherValue { matcher } )
0 commit comments