Skip to content

Commit

Permalink
Fix conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
maximebuyse committed Oct 24, 2024
1 parent 556dfb0 commit 011c076
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
8 changes: 4 additions & 4 deletions engine/lib/ast_builder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ module Make (F : Features.T) = struct
p =
PConstruct
{
name =
constructor =
Global_ident.of_name
(Constructor { is_struct = false })
Core__ops__control_flow__ControlFlow__Break;
args =
fields =
[
{
field =
Expand All @@ -95,11 +95,11 @@ module Make (F : Features.T) = struct
p =
PConstruct
{
name =
constructor =
Global_ident.of_name
(Constructor { is_struct = false })
Core__ops__control_flow__ControlFlow__Continue;
args =
fields =
[
{
field =
Expand Down
11 changes: 8 additions & 3 deletions engine/lib/generic_printer/generic_printer_template.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct
method expr'_Borrow ~super:_ ~kind:_ ~e:_ ~witness:_ =
default_document_for "expr'_Borrow"

method expr'_Break ~super:_ ~e:_ ~label:_ ~witness:_ =
method expr'_Break ~super:_ ~e:_ ~acc:_ ~label:_ ~witness:_ =
default_document_for "expr'_Break"

method expr'_Closure ~super:_ ~params:_ ~body:_ ~captures:_ =
Expand All @@ -84,7 +84,7 @@ struct
method expr'_Construct_tuple ~super:_ ~components:_ =
default_document_for "expr'_Construct_tuple"

method expr'_Continue ~super:_ ~e:_ ~label:_ ~witness:_ =
method expr'_Continue ~super:_ ~acc:_ ~label:_ ~witness:_ =
default_document_for "expr'_Continue"

method expr'_EffectAction ~super:_ ~action:_ ~argument:_ =
Expand All @@ -105,7 +105,8 @@ struct
method expr'_Literal ~super:_ _x2 = default_document_for "expr'_Literal"
method expr'_LocalVar ~super:_ _x2 = default_document_for "expr'_LocalVar"

method expr'_Loop ~super:_ ~body:_ ~kind:_ ~state:_ ~label:_ ~witness:_ =
method expr'_Loop ~super:_ ~body:_ ~kind:_ ~state:_ ~control_flow:_
~label:_ ~witness:_ =
default_document_for "expr'_Loop"

method expr'_MacroInvokation ~super:_ ~macro:_ ~args:_ ~witness:_ =
Expand All @@ -122,6 +123,10 @@ struct
method expr'_Return ~super:_ ~e:_ ~witness:_ =
default_document_for "expr'_Return"

method cf_kind_BreakOrReturn =
default_document_for "cf_kind_BreakOrReturn"

method cf_kind_BreakOnly = default_document_for "cf_kind_BreakOnly"
method field_pat ~field:_ ~pat:_ = default_document_for "field_pat"

method generic_constraint_GCLifetime _x1 _x2 =
Expand Down
4 changes: 2 additions & 2 deletions engine/lib/phases/phase_drop_return_break_continue.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ module%inlined_contents Make (F : Features.T) = struct
| Return { e; _ }, Some ({ return_type; break_type }, acc_type) ->
UA.M.expr_Constructor_CF ~return_type ~span ~break_type ~e
~acc:{ e with typ = acc_type } `Return
| ( Break { e; acc = Some (_, acc); _ },
| ( Break { e; acc = Some (acc, _); _ },
Some ({ return_type; break_type }, _) ) ->
UA.M.expr_Constructor_CF ~return_type ~span ~break_type ~e ~acc
`Break
| ( Continue { acc = Some (_, acc); _ },
| ( Continue { acc = Some (acc, _); _ },
Some ({ return_type; break_type }, _) ) ->
UA.M.expr_Constructor_CF ~return_type ~span ~break_type ~acc
`Continue
Expand Down
4 changes: 2 additions & 2 deletions engine/lib/phases/phase_local_mutation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ struct
Break
{
e = dexpr_same e;
acc = Some (w, local_vars_expr);
acc = Some (local_vars_expr, w);
label;
witness;
};
Expand All @@ -255,7 +255,7 @@ struct
let w = Features.On.state_passing_loop in
let e = local_vars_expr in
{
e = Continue { acc = Some (w, e); label; witness };
e = Continue { acc = Some (e, w); label; witness };
span = expr.span;
typ = e.typ;
}
Expand Down
4 changes: 2 additions & 2 deletions engine/lib/subtype.ml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ struct
Break
{
e = dexpr e;
acc = Option.map ~f:(S.state_passing_loop span *** dexpr) acc;
acc = Option.map ~f:(dexpr *** S.state_passing_loop span) acc;
label;
witness = (S.break span *** S.loop span) witness;
}
Expand All @@ -273,7 +273,7 @@ struct
| Continue { acc; label; witness = w1, w2 } ->
Continue
{
acc = Option.map ~f:(dexpr *** S.state_passing_loop span) e;
acc = Option.map ~f:(dexpr *** S.state_passing_loop span) acc;
label;
witness = (S.continue span w1, S.loop span w2);
}
Expand Down

0 comments on commit 011c076

Please sign in to comment.