Skip to content

Commit

Permalink
Reindent
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Evans committed Apr 16, 2024
1 parent 10369a5 commit 59bbf4d
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions bootstrap/bin/hocc/stateNub.ml
Original file line number Diff line number Diff line change
Expand Up @@ -267,26 +267,26 @@ let compat_lr1 GotoNub.{goto; _} {lr1itemsetclosure={kernel; _}; _} =
let compat_ielr1 ~resolve symbols prods GotoNub.{contribs=o_contribs; _}
{lr1itemsetclosure={index=_XXX; _}; contribs=t_contribs; _} =
let compat = Contribs.fold2_until ~init:true
~f:(fun _ _conflict_state_index Attribs.Akey.{symbol_index; _} aval_opt0 aval_opt1 ->
let Attribs.Aval.{contrib=o_contrib; _} =
Option.value ~default:Attribs.Aval.empty aval_opt0 in
let Attribs.Aval.{contrib=t_contrib; _} =
Option.value ~default:Attribs.Aval.empty aval_opt1 in
(* Merge shift into an empty contrib if the other contrib contains shift. If there is a
* shift action in the conflict, *all* lanes implicitly contribute shift, even if they don't
* contribute reduces. *)
let o_contrib, t_contrib =
match Contrib.is_empty o_contrib && Contrib.mem_shift t_contrib with
| false -> begin
match Contrib.is_empty t_contrib && Contrib.mem_shift o_contrib with
| false -> o_contrib, t_contrib
| true -> o_contrib, Contrib.shift
end
| true -> Contrib.shift, t_contrib
in
let compat = Contrib.compat_ielr1 ~resolve symbols prods symbol_index o_contrib t_contrib in
compat, not compat
) o_contribs t_contribs
~f:(fun _ _conflict_state_index Attribs.Akey.{symbol_index; _} aval_opt0 aval_opt1 ->
let Attribs.Aval.{contrib=o_contrib; _} =
Option.value ~default:Attribs.Aval.empty aval_opt0 in
let Attribs.Aval.{contrib=t_contrib; _} =
Option.value ~default:Attribs.Aval.empty aval_opt1 in
(* Merge shift into an empty contrib if the other contrib contains shift. If there is a
* shift action in the conflict, *all* lanes implicitly contribute shift, even if they don't
* contribute reduces. *)
let o_contrib, t_contrib =
match Contrib.is_empty o_contrib && Contrib.mem_shift t_contrib with
| false -> begin
match Contrib.is_empty t_contrib && Contrib.mem_shift o_contrib with
| false -> o_contrib, t_contrib
| true -> o_contrib, Contrib.shift
end
| true -> Contrib.shift, t_contrib
in
let compat = Contrib.compat_ielr1 ~resolve symbols prods symbol_index o_contrib t_contrib in
compat, not compat
) o_contribs t_contribs
in

(*
Expand Down

0 comments on commit 59bbf4d

Please sign in to comment.