diff --git a/bootstrap/bin/hocc/stateNub.ml b/bootstrap/bin/hocc/stateNub.ml index a0e9f3bd4..5b984f129 100644 --- a/bootstrap/bin/hocc/stateNub.ml +++ b/bootstrap/bin/hocc/stateNub.ml @@ -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 (*