File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,19 @@ class CompareExprReplacer : public ASR::BaseExprReplacer<CompareExprReplacer>
215
215
compare_func_map[tuple_type_name] = fn_sym;
216
216
}
217
217
218
+ /*
219
+ This function replaces `TupleCompare` with a `FunctionCall` which returns
220
+ the True if both the Tuples are equal or else returns False.
221
+ Converts:
222
+ a: tuple[i32, i32]
223
+ b: tuple[i32, i32]
224
+ assert a == b
225
+
226
+ to:
227
+ a: tuple[i32, i32]
228
+ b: tuple[i32, i32]
229
+ assert _lcompilers_tuple_compare(a, b)
230
+ */
218
231
void replace_TupleCompare (const ASR::TupleCompare_t* x) {
219
232
Location loc = x->base .base .loc ;
220
233
ASR::ttype_t * bool_type = ASRUtils::TYPE (ASR::make_Logical_t (
@@ -393,6 +406,19 @@ class CompareExprReplacer : public ASR::BaseExprReplacer<CompareExprReplacer>
393
406
compare_func_map[list_type_name] = fn_sym;
394
407
}
395
408
409
+ /*
410
+ This function replaces `ListCompare` with a `FunctionCall` which returns
411
+ the True if both the lists are equal or else returns False.
412
+ Converts:
413
+ a: list[i32]
414
+ b: list[i32]
415
+ assert a == b
416
+
417
+ to:
418
+ a: list[i32]
419
+ b: list[i32]
420
+ assert _lcompilers_list_compare(a, b)
421
+ */
396
422
void replace_ListCompare (const ASR::ListCompare_t* x) {
397
423
Location loc = x->base .base .loc ;
398
424
ASR::ttype_t * bool_type = ASRUtils::TYPE (ASR::make_Logical_t (
You can’t perform that action at this time.
0 commit comments