@@ -25,7 +25,9 @@ use cairo_lang_utils::unordered_hash_map::{Entry, UnorderedHashMap};
25
25
use cairo_lang_utils:: { Intern , extract_matches, try_extract_matches} ;
26
26
use context:: handle_lowering_flow_error;
27
27
use defs:: ids:: TopLevelLanguageElementId ;
28
- use flow_control:: create_graph:: create_graph_expr_while_let;
28
+ use flow_control:: create_graph:: {
29
+ create_graph_expr_if, create_graph_expr_match, create_graph_expr_while_let,
30
+ } ;
29
31
use flow_control:: lower_graph:: lower_graph;
30
32
use itertools:: { Itertools , chain, izip, zip_eq} ;
31
33
use num_bigint:: { BigInt , Sign } ;
@@ -50,8 +52,6 @@ use self::context::{
50
52
} ;
51
53
use self :: external:: { extern_facade_expr, extern_facade_return_tys} ;
52
54
use self :: logical_op:: lower_logical_op;
53
- use self :: lower_if:: lower_expr_if;
54
- use self :: lower_match:: lower_expr_match;
55
55
use crate :: blocks:: Blocks ;
56
56
use crate :: diagnostic:: LoweringDiagnosticKind :: { self , * } ;
57
57
use crate :: diagnostic:: LoweringDiagnosticsBuilder ;
@@ -71,9 +71,7 @@ mod external;
71
71
mod flow_control;
72
72
pub mod generators;
73
73
mod logical_op;
74
- mod lower_if;
75
74
mod lower_let_else;
76
- mod lower_match;
77
75
pub mod refs;
78
76
79
77
#[ cfg( test) ]
@@ -1204,6 +1202,27 @@ fn lower_expr_desnap<'db>(
1204
1202
) )
1205
1203
}
1206
1204
1205
+ /// Lowers an expression of type [semantic::ExprIf].
1206
+ fn lower_expr_if < ' db > (
1207
+ ctx : & mut LoweringContext < ' db , ' _ > ,
1208
+ builder : & mut BlockBuilder < ' db > ,
1209
+ expr : & semantic:: ExprIf < ' db > ,
1210
+ ) -> LoweringResult < ' db , LoweredExpr < ' db > > {
1211
+ let graph = create_graph_expr_if ( ctx, expr) ;
1212
+ lower_graph ( ctx, builder, & graph, ctx. get_location ( expr. stable_ptr . untyped ( ) ) )
1213
+ }
1214
+
1215
+ /// Lowers an expression of type [semantic::ExprMatch].
1216
+ fn lower_expr_match < ' db > (
1217
+ ctx : & mut LoweringContext < ' db , ' _ > ,
1218
+ expr : & semantic:: ExprMatch < ' db > ,
1219
+ builder : & mut BlockBuilder < ' db > ,
1220
+ ) -> LoweringResult < ' db , LoweredExpr < ' db > > {
1221
+ log:: trace!( "Lowering a match expression: {:?}" , expr. debug( & ctx. expr_formatter) ) ;
1222
+ let graph = create_graph_expr_match ( ctx, expr) ;
1223
+ lower_graph ( ctx, builder, & graph, ctx. get_location ( expr. stable_ptr . untyped ( ) ) )
1224
+ }
1225
+
1207
1226
/// Lowers an expression of type [semantic::ExprFunctionCall].
1208
1227
fn lower_expr_function_call < ' db > (
1209
1228
ctx : & mut LoweringContext < ' db , ' _ > ,
0 commit comments