Skip to content

Commit

Permalink
补回ExpTuple
Browse files Browse the repository at this point in the history
  • Loading branch information
MMZK1526 committed Sep 11, 2024
1 parent 9038e1f commit ea661bb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions IR/Conversion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ let rec trans_expr
Stmt(expr.span, Decl(result_var, UnOp(op, un_value)),
apply_expr_cont ~span:expr.span cont (var_to_value ~src:expr.span result_var)
)))
| ExpTuple elems ->
traverse_expr ~trans_worker:(trans_expr ~table ~var_table) ~span:expr.span elems (Complex
(fun value_list ->
let result_var = ANF.gen_var () in
Stmt(expr.span, Decl(result_var, MkData(Tuple(List.length(value_list)), value_list)),
apply_expr_cont ~span:expr.span cont (var_to_value ~src:expr.span result_var))
))
| ExpADT (label, elems) ->
traverse_expr ~trans_worker:(trans_expr ~table ~var_table) ~span:expr.span elems (Complex
(fun value_list ->
Expand Down

0 comments on commit ea661bb

Please sign in to comment.