@@ -44,6 +44,7 @@ module Settings = {
4444 hide_fixpoints: bool ,
4545 show_filters: bool ,
4646 show_unknown_as_hole: bool ,
47+ raise_if_padding: bool ,
4748 };
4849
4950 let of_core = (~inline, ~fold_fn_bodies=?, settings: CoreSettings . t ) => {
@@ -61,6 +62,7 @@ module Settings = {
6162 hide_fixpoints: ! settings. evaluation. show_fixpoints,
6263 show_filters: settings. evaluation. show_stepper_filters,
6364 show_unknown_as_hole: true ,
65+ raise_if_padding: false ,
6466 };
6567
6668 let editable = (~inline) => {
@@ -75,6 +77,7 @@ module Settings = {
7577 hide_fixpoints: false ,
7678 show_filters: true ,
7779 show_unknown_as_hole: true ,
80+ raise_if_padding: false ,
7881 };
7982 };
8083};
@@ -969,9 +972,12 @@ let mk_form =
969972
970973/* HACK[Matt]: Sometimes terms that should have multiple ids won't because
971974 evaluation only ever gives them one */
972- let pad_ids = (n: int , ids: list (Id . t )): list(Id . t) => {
975+ let pad_ids = (~settings : Settings . t , n: int , ids: list (Id . t )): list(Id . t) => {
973976 let len = List . length(ids);
974977 if (len < n) {
978+ if (settings. raise_if_padding) {
979+ raise (Failure ("Padding required but not enough ids provided." ));
980+ };
975981 ids @ List . init(n - len, _ => Id . mk() );
976982 } else {
977983 ListUtil . split_n(n, ids) |> fst;
@@ -1072,6 +1078,7 @@ let project_table_if = (should_project, pieces) =>
10721078 that the expression has no Closures or DynamicErrorHoles
10731079 */
10741080let rec exp_to_pretty = (~settings: Settings . t , exp: Exp . t ): pretty => {
1081+ let pad_ids = pad_ids(~settings);
10751082 let go = (~inline= settings. inline) =>
10761083 exp_to_pretty(
10771084 ~settings= {
@@ -1624,6 +1631,7 @@ let rec exp_to_pretty = (~settings: Settings.t, exp: Exp.t): pretty => {
16241631}
16251632and pat_to_pretty = (~settings: Settings . t , pat: Pat . t ): pretty => {
16261633 let go = pat_to_pretty(~settings: Settings . t );
1634+ let pad_ids = pad_ids(~settings);
16271635 let wrap = wrap_with_secondary(~secondary= settings. secondary);
16281636 /* Use settings-aware concatenation and form building */
16291637 let (@ ) = concat_segment(~secondary= settings. secondary);
@@ -1794,6 +1802,7 @@ and pat_to_pretty = (~settings: Settings.t, pat: Pat.t): pretty => {
17941802}
17951803and typ_to_pretty = (~settings: Settings . t , typ: Typ . t ): pretty => {
17961804 let go = typ_to_pretty(~settings: Settings . t );
1805+ let pad_ids = pad_ids(~settings);
17971806 let wrap = wrap_with_secondary(~secondary= settings. secondary);
17981807 /* Use settings-aware concatenation and form building */
17991808 let (@ ) = concat_segment(~secondary= settings. secondary);
@@ -2037,6 +2046,7 @@ and typ_to_pretty = (~settings: Settings.t, typ: Typ.t): pretty => {
20372046}
20382047and tpat_to_pretty = (~settings: Settings . t , tpat: TPat . t ): pretty => {
20392048 let wrap = wrap_with_secondary(~secondary= settings. secondary);
2049+ let pad_ids = pad_ids(~settings);
20402050 /* Use settings-aware concatenation and form building */
20412051 switch (tpat |> IdTagged . term_of) {
20422052 | Invalid (t ) =>
0 commit comments