diff --git a/doc/manpage_ocamlformat.mld b/doc/manpage_ocamlformat.mld index 43c1b9fa56..741e0c79d4 100644 --- a/doc/manpage_ocamlformat.mld +++ b/doc/manpage_ocamlformat.mld @@ -334,6 +334,9 @@ OPTIONS (CODE FORMATTING STYLE) --no-parse-toplevel-phrases Unset parse-toplevel-phrases. + --no-preserve-ambiguous-line-comment + Unset preserve-ambiguous-line-comment. + --no-space-around-arrays Unset space-around-arrays. @@ -401,6 +404,11 @@ OPTIONS (CODE FORMATTING STYLE) Parse and format toplevel phrases and their output. The flag is unset by default. + --preserve-ambiguous-line-comment + Do not format comments that are one-line long and may contain + whitespace-sensitive code (e.g. strings) The flag is unset by + default. + --sequence-blank-line={preserve-one|compact} Blank line between expressions of a sequence. preserve will keep a blank line between two expressions of a sequence if the input diff --git a/lib/Cmt.ml b/lib/Cmt.ml index 41e07e5004..ad61b0d58a 100644 --- a/lib/Cmt.ml +++ b/lib/Cmt.ml @@ -93,36 +93,6 @@ type decoded_kind = type decoded = {prefix: string; suffix: string; kind: decoded_kind} -(** [~content_offset] indicates at which column the body of the comment - starts (1-indexed). [~max_idnent] indicates the maximum amount of - indentation to trim. *) -let unindent_lines ?(max_indent = Stdlib.max_int) ~content_offset first_line - tl_lines = - let tl_indent = - List.fold_left ~init:max_indent - ~f:(fun acc s -> - Option.value_map ~default:acc ~f:(min acc) (String.indent_of_line s) ) - tl_lines - in - (* The indentation of the first line must account for the location of the - comment opening. Don't account for the first line if it's empty. - [fl_trim] is the number of characters to remove from the first line. *) - let fl_trim, fl_indent = - match String.indent_of_line first_line with - | Some i -> - (max 0 (min i (tl_indent - content_offset)), i + content_offset - 1) - | None -> (String.length first_line, max_indent) - in - let min_indent = min tl_indent fl_indent in - let first_line = String.drop_prefix first_line fl_trim in - first_line - :: List.map ~f:(fun s -> String.drop_prefix s min_indent) tl_lines - -let unindent_lines ?max_indent ~content_offset txt = - match String.split ~on:'\n' txt with - | [] -> [] - | hd :: tl -> unindent_lines ?max_indent ~content_offset hd tl - let is_all_whitespace s = String.for_all s ~f:Char.is_whitespace let split_asterisk_prefixed = @@ -147,18 +117,19 @@ let split_asterisk_prefixed = Some (fst_line :: List.map tl ~f:drop_prefix) | _ -> None +let ambiguous_line line = + String.contains line '"' || String.contains line '{' + || String.contains line '}' + let mk ?(prefix = "") ?(suffix = "") kind = {prefix; suffix; kind} -let decode_comment ~parse_comments_as_doc txt loc = +let decode_comment ~parse_comments_as_doc ~preserve_ambiguous_line_comments + txt loc = let txt = (* Windows compatibility *) let f = function '\r' -> false | _ -> true in String.filter txt ~f in - let opn_offset = - let {Lexing.pos_cnum; pos_bol; _} = loc.Location.loc_start in - pos_cnum - pos_bol + 1 - in if String.length txt >= 2 then match txt.[0] with | '$' when not (Char.is_whitespace txt.[1]) -> mk (Verbatim txt) @@ -173,15 +144,25 @@ let decode_comment ~parse_comments_as_doc txt loc = | '=' -> mk (Verbatim txt) | _ when is_all_whitespace txt -> mk (Verbatim " ") (* Make sure not to format to [(**)]. *) - | _ when parse_comments_as_doc -> mk (Doc txt) - | _ -> ( + | c -> ( let lines = - let content_offset = opn_offset + 2 in - unindent_lines ~content_offset txt + txt |> String.split ~on:'\n' + |> function + | [] -> [] | hd :: tl -> hd :: List.map ~f:String.lstrip tl in - match split_asterisk_prefixed lines with - | Some deprefixed_lines -> mk (Asterisk_prefixed deprefixed_lines) - | None -> mk (Normal txt) ) + match lines with + | [line] when preserve_ambiguous_line_comments && ambiguous_line line + -> + mk (Verbatim txt) + | _ -> ( + match split_asterisk_prefixed lines with + | Some deprefixed_lines -> mk (Asterisk_prefixed deprefixed_lines) + | None -> + if parse_comments_as_doc then + match c with + | '_' -> mk ~prefix:"_" (Doc (String.subo ~pos:1 txt)) + | _ -> mk (Doc txt) + else mk (Normal txt) ) ) else match txt with (* "(**)" is not parsed as a docstring but as a regular comment @@ -197,6 +178,9 @@ let decode_docstring _loc = function | txt when is_all_whitespace txt -> mk (Verbatim " ") | txt -> mk ~prefix:"*" (Doc txt) -let decode ~parse_comments_as_doc = function - | Comment {txt; loc} -> decode_comment ~parse_comments_as_doc txt loc +let decode ~parse_comments_as_doc ~preserve_ambiguous_line_comments = + function + | Comment {txt; loc} -> + decode_comment ~parse_comments_as_doc ~preserve_ambiguous_line_comments + txt loc | Docstring {txt; loc} -> decode_docstring loc txt diff --git a/lib/Cmt.mli b/lib/Cmt.mli index 15ba9b8d86..021529fe86 100644 --- a/lib/Cmt.mli +++ b/lib/Cmt.mli @@ -48,4 +48,8 @@ type decoded = ; suffix: string (** Just before the closing. *) ; kind: decoded_kind } -val decode : parse_comments_as_doc:bool -> t -> decoded +val decode : + parse_comments_as_doc:bool + -> preserve_ambiguous_line_comments:bool + -> t + -> decoded diff --git a/lib/Cmts.ml b/lib/Cmts.ml index 9c3a73f34e..4f2f765776 100644 --- a/lib/Cmts.ml +++ b/lib/Cmts.ml @@ -611,38 +611,32 @@ end module Doc = struct let fmt ~pro ~epi ~fmt_code conf ~loc txt ~offset = - (* Whether the doc starts and ends with an empty line. *) - let pre_nl, trail_nl = - let lines = String.split ~on:'\n' txt in - match lines with - | [] | [_] -> (false, false) - | h :: _ -> - let l = List.last_exn lines in - (is_only_whitespaces h, is_only_whitespaces l) + let trail_nl = + String.split ~on:'\n' txt |> List.last_exn |> is_only_whitespaces in - let txt = if pre_nl then String.lstrip txt else txt in - let txt = if trail_nl then String.rstrip txt else txt in + let trail_asterisk = String.is_suffix ~suffix:"*" txt in + let txt = String.rstrip txt in let parsed = Docstring.parse ~loc ~pro txt in (* Disable warnings when parsing of code blocks fails. *) let quiet = Conf_t.Elt.make true `Default in let conf = {conf with Conf.opr_opts= {conf.Conf.opr_opts with quiet}} in - let doc = - Fmt_odoc.fmt_parsed conf ~actually_a_doc_comment:false ~fmt_code - ~input:txt ~offset parsed - in + let doc = Fmt_odoc.fmt_parsed conf ~fmt_code ~input:txt ~offset parsed in let open Fmt in - hvbox 2 - ( str pro - $ fmt_if pre_nl "@;<1000 1>" - $ doc - $ fmt_if trail_nl "@;<1000 -2>" - $ epi ) + let trailing_space = + if trail_asterisk then noop else fmt_or trail_nl "@;<1000 -2>" " " + in + hvbox 2 (str pro $ doc $ trailing_space $ epi) end let fmt_cmt (conf : Conf.t) cmt ~fmt_code = let open Fmt in let parse_comments_as_doc = conf.fmt_opts.ocp_indent_compat.v in - let decoded = Cmt.decode ~parse_comments_as_doc cmt in + let preserve_ambiguous_line_comments = + conf.fmt_opts.preserve_ambiguous_line_comments.v + in + let decoded = + Cmt.decode ~parse_comments_as_doc ~preserve_ambiguous_line_comments cmt + in (* TODO: Offset should be computed from location. *) let offset = 2 + String.length decoded.prefix in let pro_str = "(*" ^ decoded.prefix diff --git a/lib/Conf.ml b/lib/Conf.ml index 1730564f37..45baf2b315 100644 --- a/lib/Conf.ml +++ b/lib/Conf.ml @@ -112,6 +112,7 @@ let conventional_profile from = ; type_decl= elt `Compact ; type_decl_indent= elt 2 ; wrap_comments= elt false + ; preserve_ambiguous_line_comments= elt false ; wrap_docstrings= elt true ; wrap_fun_args= elt true } @@ -183,6 +184,7 @@ let ocamlformat_profile from = ; type_decl= elt `Compact ; type_decl_indent= elt 2 ; wrap_comments= elt false + ; preserve_ambiguous_line_comments= elt false ; wrap_docstrings= elt true ; wrap_fun_args= elt true } @@ -253,6 +255,7 @@ let janestreet_profile from = ; type_decl= elt `Sparse ; type_decl_indent= elt 2 ; wrap_comments= elt true + ; preserve_ambiguous_line_comments= elt true ; wrap_docstrings= elt true ; wrap_fun_args= elt false } @@ -1310,6 +1313,19 @@ module Formatting = struct (fun conf elt -> update conf ~f:(fun f -> {f with wrap_comments= elt})) (fun conf -> conf.fmt_opts.wrap_comments) + let preserve_ambiguous_line_comments = + let doc = + "Do not format comments that are one-line long and may contain \ + whitespace-sensitive code (e.g. strings)" + in + Decl.flag ~default + ~names:["preserve-ambiguous-line-comment"] + ~doc ~kind + (fun conf elt -> + update conf ~f:(fun f -> + {f with preserve_ambiguous_line_comments= elt} ) ) + (fun conf -> conf.fmt_opts.preserve_ambiguous_line_comments) + let wrap_fun_args = let doc = "Style for function call." in let names = ["wrap-fun-args"] in @@ -1378,6 +1394,7 @@ module Formatting = struct ; elt type_decl ; elt type_decl_indent ; elt wrap_comments + ; elt preserve_ambiguous_line_comments ; elt wrap_fun_args ; (* removed options *) elt align_cases diff --git a/lib/Conf_t.ml b/lib/Conf_t.ml index 5d44f1679c..8871d9fe82 100644 --- a/lib/Conf_t.ml +++ b/lib/Conf_t.ml @@ -120,6 +120,7 @@ type fmt_opts = ; type_decl: [`Compact | `Sparse] elt ; type_decl_indent: int elt ; wrap_comments: bool elt + ; preserve_ambiguous_line_comments: bool elt ; wrap_docstrings: bool elt ; wrap_fun_args: bool elt } diff --git a/lib/Conf_t.mli b/lib/Conf_t.mli index 6d0c6df1a1..5df2250b0d 100644 --- a/lib/Conf_t.mli +++ b/lib/Conf_t.mli @@ -118,6 +118,9 @@ type fmt_opts = ; type_decl: [`Compact | `Sparse] elt ; type_decl_indent: int elt ; wrap_comments: bool elt (** Wrap comments at margin. *) + ; preserve_ambiguous_line_comments: bool elt + (** If a comment's contents may contain code whose semantics depend on whitespace, do + not wrap it. *) ; wrap_docstrings: bool elt ; wrap_fun_args: bool elt } diff --git a/lib/Fmt_ast.ml b/lib/Fmt_ast.ml index b1d608dd53..1be0d57d81 100644 --- a/lib/Fmt_ast.ml +++ b/lib/Fmt_ast.ml @@ -424,13 +424,15 @@ let fmt_parsed_docstring c ~loc ?pro ~epi input parsed = pos.pos_cnum - pos.pos_bol + 3 and fmt_code = c.fmt_code in let doc = - if - c.conf.fmt_opts.parse_docstrings.v - && String.for_all ~f:Char.is_whitespace input - then noop - else - Fmt_odoc.fmt_parsed c.conf ~actually_a_doc_comment:true ~fmt_code - ~offset ~input parsed + match input with + | "/*" -> + (* Special-case the form that toggles odoc: [(**/**)] *) str input + | _ -> + if + c.conf.fmt_opts.parse_docstrings.v + && String.for_all ~f:Char.is_whitespace input + then noop + else Fmt_odoc.fmt_parsed c.conf ~fmt_code ~offset ~input parsed in let closing_space = match parsed with diff --git a/lib/Fmt_odoc.ml b/lib/Fmt_odoc.ml index 364cddd804..ef975b5f55 100644 --- a/lib/Fmt_odoc.ml +++ b/lib/Fmt_odoc.ml @@ -74,9 +74,24 @@ let escape_balanced_brackets s = in insert_ats s "\\" (brackets_to_escape [] [] 0) +let looks_like_number w = + let w = + match String.chop_suffix w ~suffix:")" with + | Some w -> Some (String.chop_prefix_if_exists w ~prefix:"(") + | None -> ( + match String.chop_suffix w ~suffix:"]" with + | Some w -> String.chop_prefix w ~prefix:"[" + | None -> String.chop_suffix w ~suffix:"." ) + in + match w |> Option.map ~f:String.to_list with + | Some [c] -> Char.is_alphanum c && not Char.(equal c '0') + | Some (leading :: _ as w) -> + List.for_all ~f:Char.is_digit w && not Char.(equal leading '0') + | Some [] | None -> false + let escape_all s = let escapeworthy = function '{' | '}' | '[' | ']' -> true | _ -> false in - ensure_escape ~escapeworthy s + if looks_like_number s then s else ensure_escape ~escapeworthy s let split_on_whitespaces = String.split_on_chars ~on:['\t'; '\n'; '\011'; '\012'; '\r'; ' '] @@ -211,17 +226,6 @@ let space_elt c : inline_element with_location = let sp = if c.conf.fmt_opts.wrap_docstrings.v then "" else " " in Loc.(at (span []) (`Space sp)) -let looks_like_number w = - let w = - match String.chop_suffix w ~suffix:")" with - | Some w -> Some (String.chop_prefix_if_exists w ~prefix:"(") - | None -> String.chop_suffix w ~suffix:"." - in - match w |> Option.map ~f:String.to_list with - | Some [c] -> Char.is_alphanum c - | Some (_ :: _ as w) -> List.for_all ~f:Char.is_digit w - | Some [] | None -> false - let non_wrap_space sp = if String.contains sp '\n' then fmt "@\n" else str sp let rec fmt_inline_elements c elements = @@ -249,7 +253,10 @@ let rec fmt_inline_elements c elements = (non_wrap_space sp) $ aux t | `Word w :: t -> - fmt_if (String.is_prefix ~prefix:"@" w) "\\" + fmt_if + ( String.is_prefix ~prefix:"@" w + && List.mem Odoc_parser.tag_list ~equal:String.equal w ) + "\\" $ str_normalized c w $ aux t | `Code_span s :: t -> fmt_code_span s $ aux t | `Math_span s :: t -> fmt_math_span s $ aux t @@ -407,8 +414,7 @@ let beginning_offset (conf : Conf.t) input = whitespace_count else min whitespace_count 1 -let fmt_parsed (conf : Conf.t) ~actually_a_doc_comment ~fmt_code ~input - ~offset parsed = +let fmt_parsed (conf : Conf.t) ~fmt_code ~input ~offset parsed = let open Fmt in let begin_offset = beginning_offset conf input in (* The offset is used to adjust the margin when formatting code blocks. *) @@ -420,9 +426,7 @@ let fmt_parsed (conf : Conf.t) ~actually_a_doc_comment ~fmt_code ~input str (String.make begin_offset ' ') $ fmt_ast conf ~fmt_code parsed in match parsed with - | _ when not (conf.fmt_opts.parse_docstrings.v && actually_a_doc_comment) - -> - str input + | _ when not conf.fmt_opts.parse_docstrings.v -> str input | Ok parsed -> fmt_parsed parsed | Error msgs -> if (not conf.opr_opts.quiet.v) && conf.opr_opts.check_odoc_parsing.v diff --git a/lib/Fmt_odoc.mli b/lib/Fmt_odoc.mli index d1781c9b36..e034afccc0 100644 --- a/lib/Fmt_odoc.mli +++ b/lib/Fmt_odoc.mli @@ -22,7 +22,6 @@ val fmt_ast : Conf.t -> fmt_code:fmt_code -> Odoc_parser.Ast.t -> Fmt.t val fmt_parsed : Conf.t - -> actually_a_doc_comment:bool -> fmt_code:fmt_code -> input:string -> offset:int diff --git a/lib/Normalize_extended_ast.ml b/lib/Normalize_extended_ast.ml index 7a681eb292..950b8c805d 100644 --- a/lib/Normalize_extended_ast.ml +++ b/lib/Normalize_extended_ast.ml @@ -245,7 +245,16 @@ let normalize_cmt (conf : Conf.t) = let parse_comments_as_doc = conf.fmt_opts.ocp_indent_compat.v in object (self) method cmt c = - let decoded = Cmt.decode ~parse_comments_as_doc c in + (* Always pass [~preserve_ambiguous_line_comments:false] because we may + sometimes turn a multi-line comment that deserves formatting into a + single-line comment that does not. In this case, if we passed the + [preserve_ambiguous_line_comments] from the config, the former AST + would decode the comment as a [Doc] comment and the latter as + [Verbatim]. *) + let decoded = + Cmt.decode ~parse_comments_as_doc + ~preserve_ambiguous_line_comments:false c + in match decoded.Cmt.kind with | Verbatim txt -> txt | Doc txt -> diff --git a/test/cli/print_config.t b/test/cli/print_config.t index a8febc78ae..9b4c6c3946 100644 --- a/test/cli/print_config.t +++ b/test/cli/print_config.t @@ -74,6 +74,7 @@ No redundant values: type-decl=compact (profile conventional (file .ocamlformat:1)) type-decl-indent=2 (profile conventional (file .ocamlformat:1)) wrap-comments=false (profile conventional (file .ocamlformat:1)) + preserve-ambiguous-line-comment=false (profile conventional (file .ocamlformat:1)) wrap-fun-args=true (profile conventional (file .ocamlformat:1)) profile=conventional (file .ocamlformat:1) @@ -153,6 +154,7 @@ Redundant values from the conventional profile: type-decl=compact (profile conventional (file .ocamlformat:1)) type-decl-indent=2 (profile conventional (file .ocamlformat:1)) wrap-comments=false (profile conventional (file .ocamlformat:1)) + preserve-ambiguous-line-comment=false (profile conventional (file .ocamlformat:1)) wrap-fun-args=true (profile conventional (file .ocamlformat:1)) profile=conventional (file .ocamlformat:1) @@ -232,5 +234,6 @@ Redundant values from the ocamlformat profile: type-decl=compact (profile ocamlformat (file .ocamlformat:1)) type-decl-indent=2 (profile ocamlformat (file .ocamlformat:1)) wrap-comments=false (profile ocamlformat (file .ocamlformat:1)) + preserve-ambiguous-line-comment=false (profile ocamlformat (file .ocamlformat:1)) wrap-fun-args=true (profile ocamlformat (file .ocamlformat:1)) profile=ocamlformat (file .ocamlformat:1) diff --git a/test/passing/tests/apply.ml.js-ref b/test/passing/tests/apply.ml.js-ref index 8ff54dff2f..1af8a5f17e 100644 --- a/test/passing/tests/apply.ml.js-ref +++ b/test/passing/tests/apply.ml.js-ref @@ -4,10 +4,9 @@ let plus a ?(b = 0) c = a + b + c;; id (plus 1) ~b:1;; -(* The version above does not type-check, while the version below does - type-check, and should not be formatted to the above. See - https://caml.inria.fr/mantis/view.php?id=7832 for explanation on the - type-checking (and dynamic semantics) distinction. *) +(* The version above does not type-check, while the version below does type-check, and + should not be formatted to the above. See https://caml.inria.fr/mantis/view.php?id=7832 + for explanation on the type-checking (and dynamic semantics) distinction. *) (id (plus 1)) ~b:1 diff --git a/test/passing/tests/args_grouped.ml.js-ref b/test/passing/tests/args_grouped.ml.js-ref index 6a9a6e4f04..d0e018a98b 100644 --- a/test/passing/tests/args_grouped.ml.js-ref +++ b/test/passing/tests/args_grouped.ml.js-ref @@ -1,11 +1,10 @@ let nullsafe_optimistic_third_party_params_in_non_strict = CLOpt.mk_bool ~long:"nullsafe-optimistic-third-party-params-in-non-strict" - (* Turned on for compatibility reasons. Historically this is because - there was no actionable way to change third party annotations. Now - that we have such a support, this behavior should be reconsidered, - provided our tooling and error reporting is friendly enough to be - smoothly used by developers. *) + (* Turned on for compatibility reasons. Historically this is because there was no + actionable way to change third party annotations. Now that we have such a + support, this behavior should be reconsidered, provided our tooling and error + reporting is friendly enough to be smoothly used by developers. *) ~default:true "Nullsafe: in this mode we treat non annotated third party method params as if they \ were annotated as nullable." @@ -80,9 +79,8 @@ let test_file_renamings_from_json = let gen_with_record_deps ~expand t resolved_forms ~dep_kind = let foooooooooooooooooooooo = expand - (* we keep the dir constant here to replicate the old behavior of: - (chdir foo %{exe:bar}). This should lookup ./bar rather than - ./foo/bar *) + (* we keep the dir constant here to replicate the old behavior of: (chdir foo + %[{exe:bar}]). This should lookup ./bar rather than ./foo/bar *) resolved_forms ~dir:t.dir ~dep_kind @@ -94,9 +92,7 @@ let gen_with_record_deps ~expand t resolved_forms ~dep_kind = let f = very_long_function_name ~very_long_variable_name:(very_long expression) - (* this is a - multiple-line-spanning - comment *) + (* this is a multiple-line-spanning comment *) ~y ;; diff --git a/test/passing/tests/break_cases-align.ml.js-ref b/test/passing/tests/break_cases-align.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-align.ml.js-ref +++ b/test/passing/tests/break_cases-align.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-all.ml.js-ref b/test/passing/tests/break_cases-all.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-all.ml.js-ref +++ b/test/passing/tests/break_cases-all.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-closing_on_separate_line.ml.js-ref b/test/passing/tests/break_cases-closing_on_separate_line.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-closing_on_separate_line.ml.js-ref +++ b/test/passing/tests/break_cases-closing_on_separate_line.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-closing_on_separate_line_leading_nested_match_parens.ml.js-ref b/test/passing/tests/break_cases-closing_on_separate_line_leading_nested_match_parens.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-closing_on_separate_line_leading_nested_match_parens.ml.js-ref +++ b/test/passing/tests/break_cases-closing_on_separate_line_leading_nested_match_parens.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-cosl_lnmp_cmei.ml.js-ref b/test/passing/tests/break_cases-cosl_lnmp_cmei.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-cosl_lnmp_cmei.ml.js-ref +++ b/test/passing/tests/break_cases-cosl_lnmp_cmei.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-fit_or_vertical.ml.js-ref b/test/passing/tests/break_cases-fit_or_vertical.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-fit_or_vertical.ml.js-ref +++ b/test/passing/tests/break_cases-fit_or_vertical.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-nested.ml.js-ref b/test/passing/tests/break_cases-nested.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-nested.ml.js-ref +++ b/test/passing/tests/break_cases-nested.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-normal_indent.ml.js-ref b/test/passing/tests/break_cases-normal_indent.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-normal_indent.ml.js-ref +++ b/test/passing/tests/break_cases-normal_indent.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-toplevel.ml.js-ref b/test/passing/tests/break_cases-toplevel.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-toplevel.ml.js-ref +++ b/test/passing/tests/break_cases-toplevel.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases-vertical.ml.js-ref b/test/passing/tests/break_cases-vertical.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases-vertical.ml.js-ref +++ b/test/passing/tests/break_cases-vertical.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_cases.ml.js-ref b/test/passing/tests/break_cases.ml.js-ref index 11089b12ad..73c8e457e2 100644 --- a/test/passing/tests/break_cases.ml.js-ref +++ b/test/passing/tests/break_cases.ml.js-ref @@ -89,8 +89,8 @@ let () = let foo = match instr with | Store (Lvar lhs_pvar, lhs_typ, rhs_exp, loc) when Pvar.is_ssa_frontend_tmp lhs_pvar -> - (* do not need to add deref here as it is added implicitly in of_pvar - by forgetting the & *) + (* do not need to add deref here as it is added implicitly in of_pvar by forgetting + the & *) analyze_id_assignment (Var.of_pvar lhs_pvar) rhs_exp lhs_typ loc | Call ( (ret_id, _) @@ -141,7 +141,7 @@ let rec loop items = (* a comment *) loop items | _ :: items -> - (* another comment*) + (* another comment *) loop items | _ -> let a = 3 in @@ -235,13 +235,13 @@ let _ = let foooooooooooooo = function | Fooo (* fooooo foo foo foooooo foooooooo foooooooooooo *) - | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) + | Foo (* foooooo foooo fooooo fooooooo fooooooo fooooo *) | Foooooooooooooooo (* foooooo foooo fooooooooooo *) | Foooooooooooooo _ (* Foooooooooooooooooooooooooooo fooooooooooooooooooooooooooo fooooooooo. Foooooooooooooooooooooooooooooooooooo foooooooooooooooooooooooo foooooo. - Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo foooooooo. - Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. + Foooooooooooooooooooooooooooooooooooooo foooooooooooooooooooo foooooooooooooooooo + foooooooo. Foooooooooooo fooooooooooo fooooooooooooo foooooooooooooo foooooo. *) | Foooooooooo | FooooFoooooFoooooo (* fooooooooooooooooooooooooooooooooooo *) diff --git a/test/passing/tests/break_colon-before.ml.js-ref b/test/passing/tests/break_colon-before.ml.js-ref index f26f16d899..66ac6df9e5 100644 --- a/test/passing/tests/break_colon-before.ml.js-ref +++ b/test/passing/tests/break_colon-before.ml.js-ref @@ -14,8 +14,8 @@ module type M = sig : (Location.t -> Env.t -> Longident.t -> Path.t) ref val transl_modtype_longident - (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo - foooooooooooooo foooooooooooo *) + (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo foooooooooooooo + foooooooooooo *) : (Location.t -> Env.t -> Longident.t -> Path.t) ref val imported_sets_of_closures_table @@ -90,8 +90,8 @@ let array_fold_transf (f : numbering -> 'a -> numbering * 'b) n (a : 'a array) let to_clambda_function (id, (function_decl : Flambda.function_declaration)) : Clambda.ufunction = - (* All that we need in the environment, for translating one closure from a - closed set of closures, is the substitutions for variables bound to the - various closures in the set. Such closures will always be ... *) + (* All that we need in the environment, for translating one closure from a closed set of + closures, is the substitutions for variables bound to the various closures in the + set. Such closures will always be ... *) x ;; diff --git a/test/passing/tests/break_colon.ml.js-ref b/test/passing/tests/break_colon.ml.js-ref index f26f16d899..66ac6df9e5 100644 --- a/test/passing/tests/break_colon.ml.js-ref +++ b/test/passing/tests/break_colon.ml.js-ref @@ -14,8 +14,8 @@ module type M = sig : (Location.t -> Env.t -> Longident.t -> Path.t) ref val transl_modtype_longident - (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo - foooooooooooooo foooooooooooo *) + (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo foooooooooooooo + foooooooooooo *) : (Location.t -> Env.t -> Longident.t -> Path.t) ref val imported_sets_of_closures_table @@ -90,8 +90,8 @@ let array_fold_transf (f : numbering -> 'a -> numbering * 'b) n (a : 'a array) let to_clambda_function (id, (function_decl : Flambda.function_declaration)) : Clambda.ufunction = - (* All that we need in the environment, for translating one closure from a - closed set of closures, is the substitutions for variables bound to the - various closures in the set. Such closures will always be ... *) + (* All that we need in the environment, for translating one closure from a closed set of + closures, is the substitutions for variables bound to the various closures in the + set. Such closures will always be ... *) x ;; diff --git a/test/passing/tests/break_separators-after.ml.js-ref b/test/passing/tests/break_separators-after.ml.js-ref index 2f19cbc30b..c338f20486 100644 --- a/test/passing/tests/break_separators-after.ml.js-ref +++ b/test/passing/tests/break_separators-after.ml.js-ref @@ -9,7 +9,7 @@ type x = | B of { (* fooooooooooooooooooooooooooooooooooooooooo *) aaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaa - ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*) + ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbb : bbbbbbbbbbbbbbb } @@ -184,8 +184,8 @@ let length = [ 0; 14; (* foo *) 14; 17 (* foo *); 17; 2777777777777777777777777777777777; 27 ] [@foo] ;; -(* Comprehensions are invariant under separator placement and wrapping vs. - breaking, but respect delimiter docking behavior *) +(* Comprehensions are invariant under separator placement and wrapping vs. breaking, but + respect delimiter docking behavior *) (* this is a list comprehension *) let pythagorean = @@ -260,7 +260,7 @@ type t = type t = (* foooooooooooo *) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -> (* foooooooooooooooooooooooooooooooo*) + -> (* foooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -> (* fooooooooooooooooo *) ccccccccccccccccccccccccc @@ -289,8 +289,8 @@ type t = type t = { (* fooooooooooooooooo *) foo : foo - ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo - foooooooooooooooooo foooooooooooooooo *) + ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo foooooooooooooooooo + foooooooooooooooo *) foo : (* fooooooooooooooooooo *) foooooooooooo diff --git a/test/passing/tests/break_separators-after_docked.ml.js-ref b/test/passing/tests/break_separators-after_docked.ml.js-ref index 2f19cbc30b..c338f20486 100644 --- a/test/passing/tests/break_separators-after_docked.ml.js-ref +++ b/test/passing/tests/break_separators-after_docked.ml.js-ref @@ -9,7 +9,7 @@ type x = | B of { (* fooooooooooooooooooooooooooooooooooooooooo *) aaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaa - ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*) + ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbb : bbbbbbbbbbbbbbb } @@ -184,8 +184,8 @@ let length = [ 0; 14; (* foo *) 14; 17 (* foo *); 17; 2777777777777777777777777777777777; 27 ] [@foo] ;; -(* Comprehensions are invariant under separator placement and wrapping vs. - breaking, but respect delimiter docking behavior *) +(* Comprehensions are invariant under separator placement and wrapping vs. breaking, but + respect delimiter docking behavior *) (* this is a list comprehension *) let pythagorean = @@ -260,7 +260,7 @@ type t = type t = (* foooooooooooo *) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -> (* foooooooooooooooooooooooooooooooo*) + -> (* foooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -> (* fooooooooooooooooo *) ccccccccccccccccccccccccc @@ -289,8 +289,8 @@ type t = type t = { (* fooooooooooooooooo *) foo : foo - ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo - foooooooooooooooooo foooooooooooooooo *) + ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo foooooooooooooooooo + foooooooooooooooo *) foo : (* fooooooooooooooooooo *) foooooooooooo diff --git a/test/passing/tests/break_separators-before_docked.ml.js-ref b/test/passing/tests/break_separators-before_docked.ml.js-ref index 2f19cbc30b..c338f20486 100644 --- a/test/passing/tests/break_separators-before_docked.ml.js-ref +++ b/test/passing/tests/break_separators-before_docked.ml.js-ref @@ -9,7 +9,7 @@ type x = | B of { (* fooooooooooooooooooooooooooooooooooooooooo *) aaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaa - ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*) + ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbb : bbbbbbbbbbbbbbb } @@ -184,8 +184,8 @@ let length = [ 0; 14; (* foo *) 14; 17 (* foo *); 17; 2777777777777777777777777777777777; 27 ] [@foo] ;; -(* Comprehensions are invariant under separator placement and wrapping vs. - breaking, but respect delimiter docking behavior *) +(* Comprehensions are invariant under separator placement and wrapping vs. breaking, but + respect delimiter docking behavior *) (* this is a list comprehension *) let pythagorean = @@ -260,7 +260,7 @@ type t = type t = (* foooooooooooo *) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -> (* foooooooooooooooooooooooooooooooo*) + -> (* foooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -> (* fooooooooooooooooo *) ccccccccccccccccccccccccc @@ -289,8 +289,8 @@ type t = type t = { (* fooooooooooooooooo *) foo : foo - ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo - foooooooooooooooooo foooooooooooooooo *) + ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo foooooooooooooooooo + foooooooooooooooo *) foo : (* fooooooooooooooooooo *) foooooooooooo diff --git a/test/passing/tests/break_separators.ml.js-ref b/test/passing/tests/break_separators.ml.js-ref index 2f19cbc30b..c338f20486 100644 --- a/test/passing/tests/break_separators.ml.js-ref +++ b/test/passing/tests/break_separators.ml.js-ref @@ -9,7 +9,7 @@ type x = | B of { (* fooooooooooooooooooooooooooooooooooooooooo *) aaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaa - ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo*) + ; (* foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbb : bbbbbbbbbbbbbbb } @@ -184,8 +184,8 @@ let length = [ 0; 14; (* foo *) 14; 17 (* foo *); 17; 2777777777777777777777777777777777; 27 ] [@foo] ;; -(* Comprehensions are invariant under separator placement and wrapping vs. - breaking, but respect delimiter docking behavior *) +(* Comprehensions are invariant under separator placement and wrapping vs. breaking, but + respect delimiter docking behavior *) (* this is a list comprehension *) let pythagorean = @@ -260,7 +260,7 @@ type t = type t = (* foooooooooooo *) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - -> (* foooooooooooooooooooooooooooooooo*) + -> (* foooooooooooooooooooooooooooooooo *) bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -> (* fooooooooooooooooo *) ccccccccccccccccccccccccc @@ -289,8 +289,8 @@ type t = type t = { (* fooooooooooooooooo *) foo : foo - ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo - foooooooooooooooooo foooooooooooooooo *) + ; (* foooooooooooooooooooooo fooooooooooooooooooo fooooooooooooooo foooooooooooooooooo + foooooooooooooooo *) foo : (* fooooooooooooooooooo *) foooooooooooo diff --git a/test/passing/tests/cinaps.ml.js-ref b/test/passing/tests/cinaps.ml.js-ref index 2ef03a0595..d374400ce6 100644 --- a/test/passing/tests/cinaps.ml.js-ref +++ b/test/passing/tests/cinaps.ml.js-ref @@ -47,8 +47,8 @@ let foo = foo [1;2;3] ) *) let foo = foo -(* Cinaps comment should not wrap if they don't parse. The first one would - crash and the second become a mess *) +(* Cinaps comment should not wrap if they don't parse. The first one would crash and the + second become a mess *) (*$(**)" "*) @@ -64,8 +64,7 @@ let foo = foo (*$*) (*$ - (* - x + (* x *) *) diff --git a/test/passing/tests/comment_header.ml.js-ref b/test/passing/tests/comment_header.ml.js-ref index aabb853bdc..494f3c7693 100644 --- a/test/passing/tests/comment_header.ml.js-ref +++ b/test/passing/tests/comment_header.ml.js-ref @@ -13,8 +13,7 @@ (* *) (**************************************************************************) -(* XXXXXXX xxxxxxxxxxxxx XXXXXXXXXXXXXXXXXXXXx xxxxxxxxx xxxxxxxxx x xxxxxx - xxxxxx. *) +(* XXXXXXX xxxxxxxxxxxxx XXXXXXXXXXXXXXXXXXXXx xxxxxxxxx xxxxxxxxx x xxxxxx xxxxxx. *) open Module @@ -43,8 +42,7 @@ type typ = typ (* xx xxxxxxxxxxxxxx, x xxxxxxxxxxxxxx "xxxxxxxxx" xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxx. *) -(* TEST - arguments = "???" +(* TEST arguments = "???" *) (* On Windows the runtime expand windows wildcards (asterisks and diff --git a/test/passing/tests/comment_in_empty.ml.js-ref b/test/passing/tests/comment_in_empty.ml.js-ref index 3293c4145a..9ec98bb1be 100644 --- a/test/passing/tests/comment_in_empty.ml.js-ref +++ b/test/passing/tests/comment_in_empty.ml.js-ref @@ -31,18 +31,16 @@ let x = end ;; -type t = private [> (*this variant is empty *) ] +type t = private [> (* this variant is empty *) ] type t = < (* this object type is empty *) > type t = < .. (* this object type is empty *) > let x = - ( (* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non - risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, - ultricies sed, dolor. *) ) + ( (* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse + lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. *) ) ;; let x = - [ (* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non - risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, - ultricies sed, dolor. *) ] + [ (* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse + lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. *) ] ;; diff --git a/test/passing/tests/comment_last.ml.js-ref b/test/passing/tests/comment_last.ml.js-ref index 2006814fe3..b883b30470 100644 --- a/test/passing/tests/comment_last.ml.js-ref +++ b/test/passing/tests/comment_last.ml.js-ref @@ -1,4 +1,4 @@ let x = 2 let y = 3 -(*comment*) +(* comment *) diff --git a/test/passing/tests/comments-no-wrap.ml.js-ref b/test/passing/tests/comments-no-wrap.ml.js-ref index ff4dd20530..73b913f02a 100644 --- a/test/passing/tests/comments-no-wrap.ml.js-ref +++ b/test/passing/tests/comments-no-wrap.ml.js-ref @@ -8,12 +8,12 @@ (*$ *) (*$ *) -let _ = f (*f*) a (*a*) ~b (*comment*) ~c:(*comment*) c' ?d ?e () +let _ = f (*f*) a (*a*) ~b (* comment *) ~c:(* comment *) c' ?d ?e () let _ = let _ = f - (*comment*) + (* comment *) (let open M in let x = x in e) @@ -21,7 +21,7 @@ let _ = () ;; -let _ = (*comment*) a (*comment*), b +let _ = (* comment *) a (* comment *), b let foo = function | Blah ((* old *) x, y) -> () @@ -106,13 +106,13 @@ let (b :: c (* d *)) = x module rec A = struct end -(*test*) +(* test *) and B = struct end module type T = sig module rec A : sig end - (*test*) + (* test *) and B : sig end end @@ -205,7 +205,8 @@ let () = type t = | Aaaaaaaaaa - (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. *) + (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. *) | Bbbbbbbbbb (* foo *) | Bbbbbbbbbb (* foo *) @@ -222,10 +223,10 @@ let () = ;; let rec fooooooooooo = function - (*XX*) - | x :: t (*YY*) -> k - (* AA*) - | [ (*BB*) + (* XX *) + | x :: t (* YY *) -> k + (* AA *) + | [ (* BB *) (* CC *) x (* DD *) @@ -235,15 +236,15 @@ let rec fooooooooooo = function (* GG *) ] (* HH *) -> k - (* AA*) - (*BB*) + (* AA *) + (* BB *) (* CC *) | x (* DD *) :: (* EE *) t (* FF *) (* GG *) (* HH *) -> k - (* AA*) - (*BB*) + (* AA *) + (* BB *) (* CC *) | x (* DD *) diff --git a/test/passing/tests/comments.ml.js-ref b/test/passing/tests/comments.ml.js-ref index ff4dd20530..73b913f02a 100644 --- a/test/passing/tests/comments.ml.js-ref +++ b/test/passing/tests/comments.ml.js-ref @@ -8,12 +8,12 @@ (*$ *) (*$ *) -let _ = f (*f*) a (*a*) ~b (*comment*) ~c:(*comment*) c' ?d ?e () +let _ = f (*f*) a (*a*) ~b (* comment *) ~c:(* comment *) c' ?d ?e () let _ = let _ = f - (*comment*) + (* comment *) (let open M in let x = x in e) @@ -21,7 +21,7 @@ let _ = () ;; -let _ = (*comment*) a (*comment*), b +let _ = (* comment *) a (* comment *), b let foo = function | Blah ((* old *) x, y) -> () @@ -106,13 +106,13 @@ let (b :: c (* d *)) = x module rec A = struct end -(*test*) +(* test *) and B = struct end module type T = sig module rec A : sig end - (*test*) + (* test *) and B : sig end end @@ -205,7 +205,8 @@ let () = type t = | Aaaaaaaaaa - (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. *) + (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. *) | Bbbbbbbbbb (* foo *) | Bbbbbbbbbb (* foo *) @@ -222,10 +223,10 @@ let () = ;; let rec fooooooooooo = function - (*XX*) - | x :: t (*YY*) -> k - (* AA*) - | [ (*BB*) + (* XX *) + | x :: t (* YY *) -> k + (* AA *) + | [ (* BB *) (* CC *) x (* DD *) @@ -235,15 +236,15 @@ let rec fooooooooooo = function (* GG *) ] (* HH *) -> k - (* AA*) - (*BB*) + (* AA *) + (* BB *) (* CC *) | x (* DD *) :: (* EE *) t (* FF *) (* GG *) (* HH *) -> k - (* AA*) - (*BB*) + (* AA *) + (* BB *) (* CC *) | x (* DD *) diff --git a/test/passing/tests/comments_in_record.ml.js-ref b/test/passing/tests/comments_in_record.ml.js-ref index 1fa99b4baa..a2358845ff 100644 --- a/test/passing/tests/comments_in_record.ml.js-ref +++ b/test/passing/tests/comments_in_record.ml.js-ref @@ -47,9 +47,11 @@ let x = type t = { a : int option - (* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccc ddddddddddddddddd eeeee *) + (* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccc + ddddddddddddddddd eeeee *) ; b : float - (* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccc ddddddddddddddddd eeeee *) + (* aaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccc + ddddddddddddddddd eeeee *) } type t = diff --git a/test/passing/tests/doc_comments-after.ml.js-ref b/test/passing/tests/doc_comments-after.ml.js-ref index 43cbcfc23d..7c86c2ed21 100644 --- a/test/passing/tests/doc_comments-after.ml.js-ref +++ b/test/passing/tests/doc_comments-after.ml.js-ref @@ -256,8 +256,8 @@ module A = struct end (* Same with get_pure, except that when we have both "x = t" and "y = t" where t is a primed ident, -* we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before -* processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) + * we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before + * processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) let _ = () (** Tags without text *) diff --git a/test/passing/tests/doc_comments-before-except-val.ml.js-ref b/test/passing/tests/doc_comments-before-except-val.ml.js-ref index 43cbcfc23d..7c86c2ed21 100644 --- a/test/passing/tests/doc_comments-before-except-val.ml.js-ref +++ b/test/passing/tests/doc_comments-before-except-val.ml.js-ref @@ -256,8 +256,8 @@ module A = struct end (* Same with get_pure, except that when we have both "x = t" and "y = t" where t is a primed ident, -* we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before -* processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) + * we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before + * processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) let _ = () (** Tags without text *) diff --git a/test/passing/tests/doc_comments-before.ml.js-ref b/test/passing/tests/doc_comments-before.ml.js-ref index 43cbcfc23d..7c86c2ed21 100644 --- a/test/passing/tests/doc_comments-before.ml.js-ref +++ b/test/passing/tests/doc_comments-before.ml.js-ref @@ -256,8 +256,8 @@ module A = struct end (* Same with get_pure, except that when we have both "x = t" and "y = t" where t is a primed ident, -* we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before -* processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) + * we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before + * processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) let _ = () (** Tags without text *) diff --git a/test/passing/tests/doc_comments-no-parse-docstrings.mli.js-ref b/test/passing/tests/doc_comments-no-parse-docstrings.mli.js-ref index 71011f4afe..c6d92db2eb 100644 --- a/test/passing/tests/doc_comments-no-parse-docstrings.mli.js-ref +++ b/test/passing/tests/doc_comments-no-parse-docstrings.mli.js-ref @@ -273,7 +273,7 @@ end (** [[ ] [] \]] *) -(** \{ \} \[ \] \@ \@ *) +(** \{ \} \[ \] @ @ *) (** @canonical Foo *) @@ -456,7 +456,7 @@ end (** This is a comment with code inside {[ (** This is a comment with code inside [ let code inside = f inside ] *) - let code inside (* comment *) = f inside + let code inside (* comment *) = f inside ]} Code block with metadata: @@ -470,7 +470,7 @@ end {@ocaml kind=toplevel env=e1[ (** This is a comment with code inside [ let code inside = f inside ] *) - let code inside (* comment *) = f inside + let code inside (* comment *) = f inside ]} *) (** {e foooooooo oooooooooo ooooooooo ooooooooo} {i fooooooooooooo oooooooo oooooooooo} @@ -567,29 +567,25 @@ val k : int risus sed rhoncus. Ut condimentum rhoncus orci, sit amet eleifend erat tempus quis. *) (** {[ - (* a - b *) + (* a b *) ]} *) val a : fooooooooooooooooooooooooooo (** {[ - (* a - b *) + (* a b *) ]} *) -> fooooooooooooooooooooooooo type x = { a : t (** {[ - (* a - b *) + (* a b *) ]} *) ; b : [ `A (** {[ - (* a - b *) + (* a b *) ]} *) ] } @@ -597,13 +593,11 @@ type x = type x = | A of a (** {[ - (* a - b *) + (* a b *) ]} *) | B of b (** {[ - (* a - b *) + (* a b *) ]} *) (** Set a different language name in the block metadata to not format as OCaml: @@ -671,4 +665,4 @@ type x = (** at@ *) -(** \@at *) +(** @at *) diff --git a/test/passing/tests/doc_comments-no-wrap.mli.js-ref b/test/passing/tests/doc_comments-no-wrap.mli.js-ref index 71011f4afe..c6d92db2eb 100644 --- a/test/passing/tests/doc_comments-no-wrap.mli.js-ref +++ b/test/passing/tests/doc_comments-no-wrap.mli.js-ref @@ -273,7 +273,7 @@ end (** [[ ] [] \]] *) -(** \{ \} \[ \] \@ \@ *) +(** \{ \} \[ \] @ @ *) (** @canonical Foo *) @@ -456,7 +456,7 @@ end (** This is a comment with code inside {[ (** This is a comment with code inside [ let code inside = f inside ] *) - let code inside (* comment *) = f inside + let code inside (* comment *) = f inside ]} Code block with metadata: @@ -470,7 +470,7 @@ end {@ocaml kind=toplevel env=e1[ (** This is a comment with code inside [ let code inside = f inside ] *) - let code inside (* comment *) = f inside + let code inside (* comment *) = f inside ]} *) (** {e foooooooo oooooooooo ooooooooo ooooooooo} {i fooooooooooooo oooooooo oooooooooo} @@ -567,29 +567,25 @@ val k : int risus sed rhoncus. Ut condimentum rhoncus orci, sit amet eleifend erat tempus quis. *) (** {[ - (* a - b *) + (* a b *) ]} *) val a : fooooooooooooooooooooooooooo (** {[ - (* a - b *) + (* a b *) ]} *) -> fooooooooooooooooooooooooo type x = { a : t (** {[ - (* a - b *) + (* a b *) ]} *) ; b : [ `A (** {[ - (* a - b *) + (* a b *) ]} *) ] } @@ -597,13 +593,11 @@ type x = type x = | A of a (** {[ - (* a - b *) + (* a b *) ]} *) | B of b (** {[ - (* a - b *) + (* a b *) ]} *) (** Set a different language name in the block metadata to not format as OCaml: @@ -671,4 +665,4 @@ type x = (** at@ *) -(** \@at *) +(** @at *) diff --git a/test/passing/tests/doc_comments-no-wrap.mli.ref b/test/passing/tests/doc_comments-no-wrap.mli.ref index c8ec426f8c..4395a28d25 100644 --- a/test/passing/tests/doc_comments-no-wrap.mli.ref +++ b/test/passing/tests/doc_comments-no-wrap.mli.ref @@ -268,7 +268,7 @@ end (** [[ ] [] \]] *) -(** \{ \} \[ \] \@ \@ *) +(** \{ \} \[ \] @ @ *) (** @canonical Foo *) @@ -674,4 +674,4 @@ type x = (** at@ *) -(** \@at *) +(** @at *) diff --git a/test/passing/tests/doc_comments.ml.js-ref b/test/passing/tests/doc_comments.ml.js-ref index 43cbcfc23d..7c86c2ed21 100644 --- a/test/passing/tests/doc_comments.ml.js-ref +++ b/test/passing/tests/doc_comments.ml.js-ref @@ -256,8 +256,8 @@ module A = struct end (* Same with get_pure, except that when we have both "x = t" and "y = t" where t is a primed ident, -* we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before -* processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) + * we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before + * processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *) let _ = () (** Tags without text *) diff --git a/test/passing/tests/doc_comments.mli.js-ref b/test/passing/tests/doc_comments.mli.js-ref index 71011f4afe..c6d92db2eb 100644 --- a/test/passing/tests/doc_comments.mli.js-ref +++ b/test/passing/tests/doc_comments.mli.js-ref @@ -273,7 +273,7 @@ end (** [[ ] [] \]] *) -(** \{ \} \[ \] \@ \@ *) +(** \{ \} \[ \] @ @ *) (** @canonical Foo *) @@ -456,7 +456,7 @@ end (** This is a comment with code inside {[ (** This is a comment with code inside [ let code inside = f inside ] *) - let code inside (* comment *) = f inside + let code inside (* comment *) = f inside ]} Code block with metadata: @@ -470,7 +470,7 @@ end {@ocaml kind=toplevel env=e1[ (** This is a comment with code inside [ let code inside = f inside ] *) - let code inside (* comment *) = f inside + let code inside (* comment *) = f inside ]} *) (** {e foooooooo oooooooooo ooooooooo ooooooooo} {i fooooooooooooo oooooooo oooooooooo} @@ -567,29 +567,25 @@ val k : int risus sed rhoncus. Ut condimentum rhoncus orci, sit amet eleifend erat tempus quis. *) (** {[ - (* a - b *) + (* a b *) ]} *) val a : fooooooooooooooooooooooooooo (** {[ - (* a - b *) + (* a b *) ]} *) -> fooooooooooooooooooooooooo type x = { a : t (** {[ - (* a - b *) + (* a b *) ]} *) ; b : [ `A (** {[ - (* a - b *) + (* a b *) ]} *) ] } @@ -597,13 +593,11 @@ type x = type x = | A of a (** {[ - (* a - b *) + (* a b *) ]} *) | B of b (** {[ - (* a - b *) + (* a b *) ]} *) (** Set a different language name in the block metadata to not format as OCaml: @@ -671,4 +665,4 @@ type x = (** at@ *) -(** \@at *) +(** @at *) diff --git a/test/passing/tests/doc_comments.mli.ref b/test/passing/tests/doc_comments.mli.ref index 5f2dc08710..ffa1083090 100644 --- a/test/passing/tests/doc_comments.mli.ref +++ b/test/passing/tests/doc_comments.mli.ref @@ -268,7 +268,7 @@ end (** [[ ] [] \]] *) -(** \{ \} \[ \] \@ \@ *) +(** \{ \} \[ \] @ @ *) (** @canonical Foo *) @@ -668,4 +668,4 @@ type x = (** at@ *) -(** \@at *) +(** @at *) diff --git a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.err b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.err index 0020f2deb7..e5ae07ec90 100644 --- a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.err +++ b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.err @@ -1,3 +1,6 @@ Warning: Invalid documentation comment: -File "tests/doc_syntax_edge_cases.ml", line 126, characters 19-19: +File "tests/doc_syntax_edge_cases.ml", line 168, characters 19-19: End of text is not allowed in '{v ... v}' (verbatim text). +Warning: Invalid documentation comment: +File "tests/doc_syntax_edge_cases.ml", line 284, characters 39-39: +End of text is not allowed in '{%...%}' (raw markup). diff --git a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-err b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-err index 0020f2deb7..e5ae07ec90 100644 --- a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-err +++ b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-err @@ -1,3 +1,6 @@ Warning: Invalid documentation comment: -File "tests/doc_syntax_edge_cases.ml", line 126, characters 19-19: +File "tests/doc_syntax_edge_cases.ml", line 168, characters 19-19: End of text is not allowed in '{v ... v}' (verbatim text). +Warning: Invalid documentation comment: +File "tests/doc_syntax_edge_cases.ml", line 284, characters 39-39: +End of text is not allowed in '{%...%}' (raw markup). diff --git a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-ref b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-ref index 6c1f67a7df..e950d5a620 100644 --- a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-ref +++ b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.js-ref @@ -20,8 +20,7 @@ (* {01 very important} *) -(* [ code - with newline ] *) +(* [ code with newline ] *) (* We want nested bulleted lists. - Here's one layer of the list @@ -35,16 +34,15 @@ Now this is a paragraph - Now it's a list - - One more time. - Note this won't be part of this first bullet again --- that probably makes sense. + - One more time. Note this won't be part of this first bullet again --- that probably + makes sense. *) (* - If the first line of a comment is a list - This should work, as long as we handle the comment sigil correctly *) -(* - - This should even be true +(* - This should even be true - If there is a blank line before the first line *) @@ -58,13 +56,14 @@ (* Also for explicit lists {ul - {- This is a list.} - {- One of the bullets + {- This is a list. } + {- One of the bullets has some paragraphs - inside} - {- Then there's another bullet.} + inside + } + {- Then there's another bullet. } } *) @@ -72,43 +71,88 @@ {v no space - some space - some more space v} + some space + some more space + v} *) (* Numbered list examples: 1. Top-level 2. Second bullet - - With a nested - - numbered list - - Or a not nested bulleted list + - With a nested + - numbered list + + - Or a not nested bulleted list (a) with a nested numbered list - (b) this is still nested + (b) this is still nested a) This is a new list - Avoid breaking the line if list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. + Avoid breaking the line if + list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. A) We can also have a numbered list with line breaks between the bullets - B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond liiiiiiiiiiiiiiiiiiiine + B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond + liiiiiiiiiiiiiiiiiiiine But this paragraph is already not part of the list C) And so this is not a third list item, but just a normal paragraph (see - indeeeeeeeeeeeeeeeeeeeentation) + indeeeeeeeeeeeeeeeeeeeentation) (* CR-someday comments: Fix this edge case *) here's a funny edge case: - a) + b) + a) + + b) - big num: 999999999999999999999999999999. + big num: 999999999999999999999999999999 big float: 999999999999999999999999999999.0 *) +(* Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code +*) + +(* Regression for comment preservation check \[0\] *) + +(* Regression for comment preservation check [1] *) + +(* [1] Regression for comment preservation check *) + +(* this is a comment that could be code that cares about space: " hello " *) + +(* so is this: {| hello |} *) + +(* and this: {%foo bar| hello |bar} *) + +(* let x = { y = z } *) + +(* let f : _ @ a -> _ @ b = g *) + +(* this comment will become " sus " *) + +(* syntax change regression test + {[ + type t : immediate + ]} +*) + +(* flower comment + * with + * strange + * indentation + *) + +(* /**) + (** [{xinvalid markup}] *) (** valid markup [{but no space}] *) @@ -128,7 +172,7 @@ (** Markup contains numbered list: {i O(log n)} *) -(** Here is an \@ and here are two \@@ and here's a bad tag \@yo *) +(** Here is an @ and here are two @@ and here's a bad tag @yo *) (** {1 very important} *) @@ -216,6 +260,38 @@ big float: 999999999999999999999999999999.0 *) +(** Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(** Regression for comment preservation check \[0\] *) + +(** Regression for comment preservation check [1] *) + +(** [1] Regression for comment preservation check *) + +(**/**) + +(** this is a comment that could be code that cares about space: " hello " *) + +(** so is this: [{| hello |}] *) + +(** and this: {%foo bar| hello |bar} *) + +(** let x = [{ y = z }] *) + +(** let f : _ @ a -> _ @ b = g *) + +(** this comment will become " sus " *) + +(** syntax change regression test + {[ + type t : immediate + ]} *) + (*_ {xinvalid markup} *) (*_ valid markup {but no space} *) @@ -238,8 +314,7 @@ (*_ {01 very important} *) -(*_ [ code - with newline ] *) +(*_ [ code with newline ] *) (*_ We want nested bulleted lists. - Here's one layer of the list @@ -253,17 +328,16 @@ Now this is a paragraph - Now it's a list - - One more time. - Note this won't be part of this first bullet again --- that probably makes sense. + - One more time. Note this won't be part of this first bullet again --- that + probably makes sense. *) (*_ - If the first line of a comment is a list - This should work, as long as we handle the comment sigil correctly *) -(*_ - - This should even be true - - If there is a blank line before the first line +(*_ - This should even be true + - If there is a blank line before the first line *) (*_ We want big things to be able to go inside lists nicely. @@ -276,13 +350,14 @@ (*_ Also for explicit lists {ul - {- This is a list.} - {- One of the bullets + {- This is a list. } + {- One of the bullets has some paragraphs - inside} - {- Then there's another bullet.} + inside + } + {- Then there's another bullet. } } *) @@ -290,37 +365,76 @@ {v no space - some space - some more space v} + some space + some more space + v} *) (*_ Numbered list examples: 1. Top-level 2. Second bullet - - With a nested - - numbered list - - Or a not nested bulleted list + - With a nested + - numbered list + + - Or a not nested bulleted list (a) with a nested numbered list - (b) this is still nested + (b) this is still nested a) This is a new list - Avoid breaking the line if list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. + Avoid breaking the line if + list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. A) We can also have a numbered list with line breaks between the bullets - B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond liiiiiiiiiiiiiiiiiiiine + B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond + liiiiiiiiiiiiiiiiiiiine But this paragraph is already not part of the list C) And so this is not a third list item, but just a normal paragraph (see - indeeeeeeeeeeeeeeeeeeeentation) + indeeeeeeeeeeeeeeeeeeeentation) here's a funny edge case: - a) + b) + a) + + b) - big num: 999999999999999999999999999999. + big num: 999999999999999999999999999999 big float: 999999999999999999999999999999.0 *) + +(*_ Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code +*) + +(*_ Regression for comment preservation check \[0\] *) + +(*_ Regression for comment preservation check [1] *) + +(*_ [1] Regression for comment preservation check *) + +(*_ this is a comment that could be code that cares about space: " hello " *) + +(*_ so is this: {| hello |} *) + +(*_ and this: {%foo bar| hello |bar} *) + +(*_ let x = { y = z } *) + +(*_ let f : _ @ a -> _ @ b = g *) + +(*_ this comment will become " sus " *) + +(*_ syntax change regression test + {[ + type t : immediate + ]} +*) + +(*_ /**) diff --git a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.ref b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.ref index 2568193836..cc0d05272a 100644 --- a/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.ref +++ b/test/passing/tests/doc_syntax_edge_cases-check_odoc.ml.ref @@ -81,6 +81,40 @@ big float: 999999999999999999999999999999.0 *) +(* Also[1] footnote-style comments[2]: + + [1] See this paper [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(* Regression for comment preservation check \[0\] *) + +(* Regression for comment preservation check \[1\] *) + +(* \[1\] Regression for comment preservation check *) + +(* this is a comment that could be code that cares about space: " hello " *) + +(* so is this: {| hello |} *) + +(* and this: {%foo bar| hello |bar} *) + +(* let x = { y = z } *) + +(* let f : _ @ a -> _ @ b = g *) + +(* this comment will become " sus " *) + +(* syntax change regression test {[ type t [@@immediate] ]} *) + +(* flower comment + * with + * strange + * indentation + *) + +(*/**) + (** [{xinvalid markup}] *) (** valid markup [{but no space}] *) @@ -100,7 +134,7 @@ (** Markup contains numbered list: {i O(log n)} *) -(** Here is an \@ and here are two \@@ and here's a bad tag \@yo *) +(** Here is an @ and here are two @@ and here's a bad tag @yo *) (** {1 very important} *) @@ -188,6 +222,38 @@ big float: 999999999999999999999999999999.0 *) +(** Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(** Regression for comment preservation check \[0\] *) + +(** Regression for comment preservation check [1] *) + +(** [1] Regression for comment preservation check *) + +(**/**) + +(** this is a comment that could be code that cares about space: " hello " *) + +(** so is this: [{| hello |}] *) + +(** and this: {%foo bar| hello |bar} *) + +(** let x = [{ y = z }] *) + +(** let f : _ @ a -> _ @ b = g *) + +(** this comment will become " sus " *) + +(** syntax change regression test + {[ + type t : immediate + ]} *) + (*_ {xinvalid markup} *) (*_ valid markup {but no space} *) @@ -268,3 +334,31 @@ big num: 999999999999999999999999999999. big float: 999999999999999999999999999999.0 *) + +(*_ Also[1] footnote-style comments[2]: + + [1] See this paper [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(*_ Regression for comment preservation check \[0\] *) + +(*_ Regression for comment preservation check \[1\] *) + +(*_ \[1\] Regression for comment preservation check *) + +(*_ this is a comment that could be code that cares about space: " hello " *) + +(*_ so is this: {| hello |} *) + +(*_ and this: {%foo bar| hello |bar} *) + +(*_ let x = { y = z } *) + +(*_ let f : _ @ a -> _ @ b = g *) + +(*_ this comment will become " sus " *) + +(*_ syntax change regression test {[ type t [@@immediate] ]} *) + +(*_/**) diff --git a/test/passing/tests/doc_syntax_edge_cases.ml b/test/passing/tests/doc_syntax_edge_cases.ml index 89ce0a2aac..89ef83f021 100644 --- a/test/passing/tests/doc_syntax_edge_cases.ml +++ b/test/passing/tests/doc_syntax_edge_cases.ml @@ -109,6 +109,48 @@ big float: 999999999999999999999999999999.0 *) +(* Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not + [B] work, however, since it is likely to be code +*) + +(* Regression for comment preservation check \[0\] *) + +(* Regression for comment preservation check \[1\] *) + +(* \[1\] Regression for comment preservation check *) + +(* this is a comment that could be code that cares about space: " hello " *) + +(* so is this: {| hello |} *) + +(* and this: {%foo bar| hello |bar} *) + +(* let x = { y = z } *) + +(* let f : _ @ a -> _ @ b = g *) + +(* this comment + will become " sus " *) + +(* syntax change regression test + {[ + type t [@@immediate] + ]} +*) + +(* flower comment + * with + * strange + * indentation +*) + +(*/**) + (** {xinvalid markup} *) (** valid markup {but no space} *) @@ -218,6 +260,42 @@ big float: 999999999999999999999999999999.0 *) +(** Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not + [B] work, however, since it is likely to be code +*) + +(** Regression for comment preservation check \[0\] *) + +(** Regression for comment preservation check \[1\] *) + +(** \[1\] Regression for comment preservation check *) + +(**/**) + +(** this is a comment that could be code that cares about space: " hello " *) + +(** so is this: {| hello |} *) + +(** and this: {%foo bar| hello |bar} *) + +(** let x = { y = z } *) + +(** let f : _ @ a -> _ @ b = g *) + +(** this comment + will become " sus " *) + +(** syntax change regression test + {[ + type t [@@immediate] + ]} +*) + (*_ {xinvalid markup} *) (*_ valid markup {but no space} *) @@ -326,3 +404,40 @@ big float: 999999999999999999999999999999.0 *) + +(*_ Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not + [B] work, however, since it is likely to be code +*) + +(*_ Regression for comment preservation check \[0\] *) + +(*_ Regression for comment preservation check \[1\] *) + +(*_ \[1\] Regression for comment preservation check *) + +(*_ this is a comment that could be code that cares about space: " hello " *) + +(*_ so is this: {| hello |} *) + +(*_ and this: {%foo bar| hello |bar} *) + +(*_ let x = { y = z } *) + +(*_ let f : _ @ a -> _ @ b = g *) + +(*_ this comment + will become " sus " *) + +(*_ syntax change regression test + {[ + type t [@@immediate] + ]} +*) + +(*_/**) + diff --git a/test/passing/tests/doc_syntax_edge_cases.ml.js-ref b/test/passing/tests/doc_syntax_edge_cases.ml.js-ref index 6c1f67a7df..e950d5a620 100644 --- a/test/passing/tests/doc_syntax_edge_cases.ml.js-ref +++ b/test/passing/tests/doc_syntax_edge_cases.ml.js-ref @@ -20,8 +20,7 @@ (* {01 very important} *) -(* [ code - with newline ] *) +(* [ code with newline ] *) (* We want nested bulleted lists. - Here's one layer of the list @@ -35,16 +34,15 @@ Now this is a paragraph - Now it's a list - - One more time. - Note this won't be part of this first bullet again --- that probably makes sense. + - One more time. Note this won't be part of this first bullet again --- that probably + makes sense. *) (* - If the first line of a comment is a list - This should work, as long as we handle the comment sigil correctly *) -(* - - This should even be true +(* - This should even be true - If there is a blank line before the first line *) @@ -58,13 +56,14 @@ (* Also for explicit lists {ul - {- This is a list.} - {- One of the bullets + {- This is a list. } + {- One of the bullets has some paragraphs - inside} - {- Then there's another bullet.} + inside + } + {- Then there's another bullet. } } *) @@ -72,43 +71,88 @@ {v no space - some space - some more space v} + some space + some more space + v} *) (* Numbered list examples: 1. Top-level 2. Second bullet - - With a nested - - numbered list - - Or a not nested bulleted list + - With a nested + - numbered list + + - Or a not nested bulleted list (a) with a nested numbered list - (b) this is still nested + (b) this is still nested a) This is a new list - Avoid breaking the line if list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. + Avoid breaking the line if + list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. A) We can also have a numbered list with line breaks between the bullets - B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond liiiiiiiiiiiiiiiiiiiine + B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond + liiiiiiiiiiiiiiiiiiiine But this paragraph is already not part of the list C) And so this is not a third list item, but just a normal paragraph (see - indeeeeeeeeeeeeeeeeeeeentation) + indeeeeeeeeeeeeeeeeeeeentation) (* CR-someday comments: Fix this edge case *) here's a funny edge case: - a) + b) + a) + + b) - big num: 999999999999999999999999999999. + big num: 999999999999999999999999999999 big float: 999999999999999999999999999999.0 *) +(* Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code +*) + +(* Regression for comment preservation check \[0\] *) + +(* Regression for comment preservation check [1] *) + +(* [1] Regression for comment preservation check *) + +(* this is a comment that could be code that cares about space: " hello " *) + +(* so is this: {| hello |} *) + +(* and this: {%foo bar| hello |bar} *) + +(* let x = { y = z } *) + +(* let f : _ @ a -> _ @ b = g *) + +(* this comment will become " sus " *) + +(* syntax change regression test + {[ + type t : immediate + ]} +*) + +(* flower comment + * with + * strange + * indentation + *) + +(* /**) + (** [{xinvalid markup}] *) (** valid markup [{but no space}] *) @@ -128,7 +172,7 @@ (** Markup contains numbered list: {i O(log n)} *) -(** Here is an \@ and here are two \@@ and here's a bad tag \@yo *) +(** Here is an @ and here are two @@ and here's a bad tag @yo *) (** {1 very important} *) @@ -216,6 +260,38 @@ big float: 999999999999999999999999999999.0 *) +(** Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(** Regression for comment preservation check \[0\] *) + +(** Regression for comment preservation check [1] *) + +(** [1] Regression for comment preservation check *) + +(**/**) + +(** this is a comment that could be code that cares about space: " hello " *) + +(** so is this: [{| hello |}] *) + +(** and this: {%foo bar| hello |bar} *) + +(** let x = [{ y = z }] *) + +(** let f : _ @ a -> _ @ b = g *) + +(** this comment will become " sus " *) + +(** syntax change regression test + {[ + type t : immediate + ]} *) + (*_ {xinvalid markup} *) (*_ valid markup {but no space} *) @@ -238,8 +314,7 @@ (*_ {01 very important} *) -(*_ [ code - with newline ] *) +(*_ [ code with newline ] *) (*_ We want nested bulleted lists. - Here's one layer of the list @@ -253,17 +328,16 @@ Now this is a paragraph - Now it's a list - - One more time. - Note this won't be part of this first bullet again --- that probably makes sense. + - One more time. Note this won't be part of this first bullet again --- that + probably makes sense. *) (*_ - If the first line of a comment is a list - This should work, as long as we handle the comment sigil correctly *) -(*_ - - This should even be true - - If there is a blank line before the first line +(*_ - This should even be true + - If there is a blank line before the first line *) (*_ We want big things to be able to go inside lists nicely. @@ -276,13 +350,14 @@ (*_ Also for explicit lists {ul - {- This is a list.} - {- One of the bullets + {- This is a list. } + {- One of the bullets has some paragraphs - inside} - {- Then there's another bullet.} + inside + } + {- Then there's another bullet. } } *) @@ -290,37 +365,76 @@ {v no space - some space - some more space v} + some space + some more space + v} *) (*_ Numbered list examples: 1. Top-level 2. Second bullet - - With a nested - - numbered list - - Or a not nested bulleted list + - With a nested + - numbered list + + - Or a not nested bulleted list (a) with a nested numbered list - (b) this is still nested + (b) this is still nested a) This is a new list - Avoid breaking the line if list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. + Avoid breaking the line if + list-like: 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. A) We can also have a numbered list with line breaks between the bullets - B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond liiiiiiiiiiiiiiiiiiiine + B) You can see this is true from the indentation of the seeeeeeeeeeeeeeeeeeeecond + liiiiiiiiiiiiiiiiiiiine But this paragraph is already not part of the list C) And so this is not a third list item, but just a normal paragraph (see - indeeeeeeeeeeeeeeeeeeeentation) + indeeeeeeeeeeeeeeeeeeeentation) here's a funny edge case: - a) + b) + a) + + b) - big num: 999999999999999999999999999999. + big num: 999999999999999999999999999999 big float: 999999999999999999999999999999.0 *) + +(*_ Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code +*) + +(*_ Regression for comment preservation check \[0\] *) + +(*_ Regression for comment preservation check [1] *) + +(*_ [1] Regression for comment preservation check *) + +(*_ this is a comment that could be code that cares about space: " hello " *) + +(*_ so is this: {| hello |} *) + +(*_ and this: {%foo bar| hello |bar} *) + +(*_ let x = { y = z } *) + +(*_ let f : _ @ a -> _ @ b = g *) + +(*_ this comment will become " sus " *) + +(*_ syntax change regression test + {[ + type t : immediate + ]} +*) + +(*_ /**) diff --git a/test/passing/tests/doc_syntax_edge_cases.ml.ref b/test/passing/tests/doc_syntax_edge_cases.ml.ref index 2568193836..cc0d05272a 100644 --- a/test/passing/tests/doc_syntax_edge_cases.ml.ref +++ b/test/passing/tests/doc_syntax_edge_cases.ml.ref @@ -81,6 +81,40 @@ big float: 999999999999999999999999999999.0 *) +(* Also[1] footnote-style comments[2]: + + [1] See this paper [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(* Regression for comment preservation check \[0\] *) + +(* Regression for comment preservation check \[1\] *) + +(* \[1\] Regression for comment preservation check *) + +(* this is a comment that could be code that cares about space: " hello " *) + +(* so is this: {| hello |} *) + +(* and this: {%foo bar| hello |bar} *) + +(* let x = { y = z } *) + +(* let f : _ @ a -> _ @ b = g *) + +(* this comment will become " sus " *) + +(* syntax change regression test {[ type t [@@immediate] ]} *) + +(* flower comment + * with + * strange + * indentation + *) + +(*/**) + (** [{xinvalid markup}] *) (** valid markup [{but no space}] *) @@ -100,7 +134,7 @@ (** Markup contains numbered list: {i O(log n)} *) -(** Here is an \@ and here are two \@@ and here's a bad tag \@yo *) +(** Here is an @ and here are two @@ and here's a bad tag @yo *) (** {1 very important} *) @@ -188,6 +222,38 @@ big float: 999999999999999999999999999999.0 *) +(** Also[1] footnote-style comments[2]: + + [1] See this paper + [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(** Regression for comment preservation check \[0\] *) + +(** Regression for comment preservation check [1] *) + +(** [1] Regression for comment preservation check *) + +(**/**) + +(** this is a comment that could be code that cares about space: " hello " *) + +(** so is this: [{| hello |}] *) + +(** and this: {%foo bar| hello |bar} *) + +(** let x = [{ y = z }] *) + +(** let f : _ @ a -> _ @ b = g *) + +(** this comment will become " sus " *) + +(** syntax change regression test + {[ + type t : immediate + ]} *) + (*_ {xinvalid markup} *) (*_ valid markup {but no space} *) @@ -268,3 +334,31 @@ big num: 999999999999999999999999999999. big float: 999999999999999999999999999999.0 *) + +(*_ Also[1] footnote-style comments[2]: + + [1] See this paper [2] Thanks for the advice + + [A] this does not [B] work, however, since it is likely to be code *) + +(*_ Regression for comment preservation check \[0\] *) + +(*_ Regression for comment preservation check \[1\] *) + +(*_ \[1\] Regression for comment preservation check *) + +(*_ this is a comment that could be code that cares about space: " hello " *) + +(*_ so is this: {| hello |} *) + +(*_ and this: {%foo bar| hello |bar} *) + +(*_ let x = { y = z } *) + +(*_ let f : _ @ a -> _ @ b = g *) + +(*_ this comment will become " sus " *) + +(*_ syntax change regression test {[ type t [@@immediate] ]} *) + +(*_/**) diff --git a/test/passing/tests/explicitly_quantified_value_descriptions.mli.js-ref b/test/passing/tests/explicitly_quantified_value_descriptions.mli.js-ref index 81c384610d..bb0b55a060 100644 --- a/test/passing/tests/explicitly_quantified_value_descriptions.mli.js-ref +++ b/test/passing/tests/explicitly_quantified_value_descriptions.mli.js-ref @@ -34,9 +34,8 @@ val f -> long_argument_1234567890 -> long_result_1234567890 -(* uncommon case where quantified types with layouts have to line wrap; note - that the type and layout may be split onto multiple lines in the middle of - wrapping *) +(* uncommon case where quantified types with layouts have to line wrap; note that the type + and layout may be split onto multiple lines in the middle of wrapping *) val f : ('long_quantified_variable_a : layout) ('long_quantified_variable_b : layout) ('long_quantified_variable_c : layout) ('long_quantified_variable_d : layout). diff --git a/test/passing/tests/function_constraint.ml.js-ref b/test/passing/tests/function_constraint.ml.js-ref index b5524a9113..7ea4e89560 100644 --- a/test/passing/tests/function_constraint.ml.js-ref +++ b/test/passing/tests/function_constraint.ml.js-ref @@ -305,7 +305,7 @@ let (* 1 *) _ (* 2 *) = f (* 4 *) (fun - (* 5*) + (* 5 *) (* 6 *) x (* 7 *) (* 8 *) @@ -328,7 +328,7 @@ let (* 1 *) _ (* 2 *) = f (* 4 *) (fun - (* 5*) + (* 5 *) (* 6 *) x : (* 8 *) unit (* 9 *) -> @@ -346,11 +346,9 @@ let[@a1] _ = (f [@a2]) (fun (x [@a3]) : (unit[@a4]) -> fun (y [@a5]) : (unit[@a6]) -> z [@a7]) ;; -(* CR: Some of the comment movement above are kind of sad. For - example this: - let f (* 2 *) (type (* 3 *) a) = (() : unit @@ local) - becomes: - let f (type (* 3 *) a) = (* 2 *) (() : unit @@ local) +(* CR: Some of the comment movement above are kind of sad. For example this: let f (* 2 *) + (type (* 3 *) a) = (() : unit @@ local) becomes: let f (type (* 3 *) a) = (* 2 *) (() : + unit @@ local) Why does (* 2 *) get moved out to the rhs? *) diff --git a/test/passing/tests/generative.ml.js-ref b/test/passing/tests/generative.ml.js-ref index 166248c658..287637c3b1 100644 --- a/test/passing/tests/generative.ml.js-ref +++ b/test/passing/tests/generative.ml.js-ref @@ -3,7 +3,7 @@ module M = Generative () module M = String_id (M) () module F2 : functor () -> sig end = F1 module F2 : functor () () -> sig end = F1 -module F2 : (*xx*) functor ( (*yy*) ) (*zz*) -> sig end = F1 +module F2 : (* xx *) functor ( (* yy *) ) (* zz *) -> sig end = F1 module F2 : functor () -> functor [@attr] () () -> sig end = F1 module F2 : functor () () () () -> sig end = F1 module F2 : functor () () () () () () -> sig end = F1 diff --git a/test/passing/tests/implicit_source_position.ml.js-ref b/test/passing/tests/implicit_source_position.ml.js-ref index 8f31287c2f..f1c9490890 100644 --- a/test/passing/tests/implicit_source_position.ml.js-ref +++ b/test/passing/tests/implicit_source_position.ml.js-ref @@ -1,9 +1,7 @@ -(* This file is the test case for erasing "implicit source position" - arguments. +(* This file is the test case for erasing "implicit source position" arguments. - The test output for this file can be found in - [implicit_source_position_erased.ml.ref]. The options for this test can be - found in [implicit_source_position_erased.ml.opts]. *) + The test output for this file can be found in [implicit_source_position_erased.ml.ref]. + The options for this test can be found in [implicit_source_position_erased.ml.opts]. *) let punned_pattern ~(call_pos : [%call_pos]) () = call_pos let ignored_pattern ~call_pos:(_ : [%call_pos]) () = 1 let destructured_pattern ~call_pos:({ pos_fname; _ } : [%call_pos]) () = () diff --git a/test/passing/tests/include_functor.ml.js-ref b/test/passing/tests/include_functor.ml.js-ref index 6fa94df23b..fb4891b03e 100644 --- a/test/passing/tests/include_functor.ml.js-ref +++ b/test/passing/tests/include_functor.ml.js-ref @@ -1,5 +1,4 @@ -(* examples taken from: - ocaml/testsuite/tests/typing-modules/include_functor.ml *) +(* examples taken from: ocaml/testsuite/tests/typing-modules/include_functor.ml *) (* In structure *) module type S = sig diff --git a/test/passing/tests/index_op.ml.js-ref b/test/passing/tests/index_op.ml.js-ref index 037771f6a4..e4f761acd9 100644 --- a/test/passing/tests/index_op.ml.js-ref +++ b/test/passing/tests/index_op.ml.js-ref @@ -126,8 +126,7 @@ let _ = let _ = a.{a, b} -(* Integers on the left of indexing operators must be surrounded by - parentheses *) +(* Integers on the left of indexing operators must be surrounded by parentheses *) let _ = (0).*(0) (* Integers with suffix and floats are fine *) diff --git a/test/passing/tests/js_args.ml.js-ref b/test/passing/tests/js_args.ml.js-ref index b5824b9458..2ab09065da 100644 --- a/test/passing/tests/js_args.ml.js-ref +++ b/test/passing/tests/js_args.ml.js-ref @@ -5,9 +5,9 @@ let should_check_can_sell_and_marking regulatory_regime = | `foo -> some_function argument ;; -(* The above typically occurs in a multi-pattern match clause, so the clause - expression is on a line by itself. This is the more typical way a long - single-pattern match clause would be written: *) +(* The above typically occurs in a multi-pattern match clause, so the clause expression is + on a line by itself. This is the more typical way a long single-pattern match clause + would be written: *) let should_check_can_sell_and_marking regulatory_regime = match z with | `foo -> some_function argument @@ -55,17 +55,17 @@ let () = raise (Bug ("foo" - (* In this and similar cases, we want the subsequent lines to - align with the first expression. *) + (* In this and similar cases, we want the subsequent lines to align with the first + expression. *) ^ "bar")); raise (Bug ("foo" ^ "quux" ^ "bar")); raise (Bug ((foo + quux) ^ "bar")); raise (Bug ((foo + quux) ^ "bar")) ;; -(* Except in specific cases, we want the argument indented relative to the - function being called. (Exceptions include "fun" arguments where the line - ends with "->" and subsequent lines beginning with operators, like above.) *) +(* Except in specific cases, we want the argument indented relative to the function being + called. (Exceptions include "fun" arguments where the line ends with "->" and + subsequent lines beginning with operators, like above.) *) let () = Some (Message_store.create @@ -75,8 +75,8 @@ let () = Message_store.Message_size.Byte) ;; -(* We like the indentation of most arguments, but want to get back towards the - left margin in a few special cases: *) +(* We like the indentation of most arguments, but want to get back towards the left margin + in a few special cases: *) let _ = foo (bar (fun x -> (* special: "fun _ ->" at EOL *) baz)) (* assume no more arguments to "bar" *) @@ -87,25 +87,24 @@ let _ = foo ~a_long_field_name:(check (fun bar -> baz)) let _ = foo (bar (quux (fnord (fun x -> (* any depth *) baz)))) -(* We also wanted to tweak the operator indentation, making operators like <= - not special cases in contexts like this: *) +(* We also wanted to tweak the operator indentation, making operators like <= not special + cases in contexts like this: *) let _ = assert (foo (bar + baz <= quux)) -(* lined up under left argument to op, - sim. to ^ above *) +(* lined up under left argument to op, sim. to ^ above *) (* Sim. indentation of if conditions: *) let _ = if a <= b then () let _ = - (* Comparisons are different than conditionals; we don't regard them as - conceptually part of the [if] expression. *) + (* Comparisons are different than conditionals; we don't regard them as conceptually + part of the [if] expression. *) if a <= b then () ;; let _ = - (* We regard the outermost condition terms as conceptually part of the [if] - expression and indent accordingly. Whether [&&] or [||], conditionals - effectively state lists of conditions for [then]. *) + (* We regard the outermost condition terms as conceptually part of the [if] expression + and indent accordingly. Whether [&&] or [||], conditionals effectively state lists of + conditions for [then]. *) if Edge_adjustment.is_zero arb.cfg.extra_edge && 0. = sys.plugs.edge_backoff && 0. = zero_acvol_edge_backoff diff --git a/test/passing/tests/js_pattern.ml.js-ref b/test/passing/tests/js_pattern.ml.js-ref index 6ee0bd4e0a..235bd1892f 100644 --- a/test/passing/tests/js_pattern.ml.js-ref +++ b/test/passing/tests/js_pattern.ml.js-ref @@ -30,8 +30,8 @@ let check_price t = function | other -> () ;; -(* Sometimes we like to write big alternations like this, in which case the - comment should typically align with the following clause. *) +(* Sometimes we like to write big alternations like this, in which case the comment should + typically align with the following clause. *) let 0 = match x with | A (* a *) -> a diff --git a/test/passing/tests/js_to_do.ml.js-ref b/test/passing/tests/js_to_do.ml.js-ref index b74b4fad55..d76db4b40f 100644 --- a/test/passing/tests/js_to_do.ml.js-ref +++ b/test/passing/tests/js_to_do.ml.js-ref @@ -14,29 +14,26 @@ let _ = (* js-type *) -(* The following tests incorporate several subtle and different indentation - ideas. Please consider this only a proposal for discussion, for now. - - First, notice the display treatment of "(,)" tuples, analogous to "[;]" - lists. While "(,)" is an intensional combination of "()" and ",", unlike - "[;]" lists, we believe "(,)" isn't too big a departure. Value expression - analogies are included in js-type.ml, (meant to be) consistent with the - proposed type indentation. - - Second, and more divergently, the proposed indentation of function types is - based on the idea of aligning the arguments, even the first argument, even - where that means automatically inserting spaces within lines. This applies - to the extra spaces in ":__unit" and "(____Config.Network.t" below. - - We believe this fits into a more general incorporation of alignment into - ocp-indent, to replace our internal alignment tool with a syntax-aware one. - We like to align things for readability, like big records, record types, - lists used to build tables, etc. - - The proposal also includes indenting "->" in the circumstances below relative - to the enclosing "()", by two spaces. In a sense, this happens first, and - then the first argument is aligned accordingly. So, there's no manual - indentation or spacing below. *) +(* The following tests incorporate several subtle and different indentation ideas. Please + consider this only a proposal for discussion, for now. + + First, notice the display treatment of "(,)" tuples, analogous to "[;]" lists. While + "(,)" is an intensional combination of "()" and ",", unlike "[;]" lists, we believe + "(,)" isn't too big a departure. Value expression analogies are included in js-type.ml, + (meant to be) consistent with the proposed type indentation. + + Second, and more divergently, the proposed indentation of function types is based on + the idea of aligning the arguments, even the first argument, even where that means + automatically inserting spaces within lines. This applies to the extra spaces in + ":__unit" and "(____Config.Network.t" below. + + We believe this fits into a more general incorporation of alignment into ocp-indent, to + replace our internal alignment tool with a syntax-aware one. We like to align things + for readability, like big records, record types, lists used to build tables, etc. + + The proposal also includes indenting "->" in the circumstances below relative to the + enclosing "()", by two spaces. In a sense, this happens first, and then the first + argument is aligned accordingly. So, there's no manual indentation or spacing below. *) val instances : unit diff --git a/test/passing/tests/js_upon.ml.js-ref b/test/passing/tests/js_upon.ml.js-ref index f386a5a53d..53f07c49f3 100644 --- a/test/passing/tests/js_upon.ml.js-ref +++ b/test/passing/tests/js_upon.ml.js-ref @@ -1,7 +1,6 @@ let f x = stop - (* We don't do this as a matter of style, but the indentation reveals a common - mistake. *) + (* We don't do this as a matter of style, but the indentation reveals a common mistake. *) >>> fun () -> don't_wait_for (close fd); bind fd @@ -9,8 +8,8 @@ let f x = let f x = (stop - (* This is what was intended, which is indented correctly, although it's bad - style on my part. *) + (* This is what was intended, which is indented correctly, although it's bad style on + my part. *) >>> fun () -> don't_wait_for (close fd)); bind ;; diff --git a/test/passing/tests/label_option_default_args.ml.js-ref b/test/passing/tests/label_option_default_args.ml.js-ref index 84cce2a20f..d29e10ef9b 100644 --- a/test/passing/tests/label_option_default_args.ml.js-ref +++ b/test/passing/tests/label_option_default_args.ml.js-ref @@ -78,8 +78,8 @@ let (* 0 *) f e ;; -(* Regression tests for https://github.com/ocaml-ppx/ocamlformat/issues/1260 - (optional argument rebound to non-variable without necessary parens). *) +(* Regression tests for https://github.com/ocaml-ppx/ocamlformat/issues/1260 (optional + argument rebound to non-variable without necessary parens). *) (* Safe without parens *) let f ?any:_ = () diff --git a/test/passing/tests/labeled_tuple_patterns.ml.js-ref b/test/passing/tests/labeled_tuple_patterns.ml.js-ref index 780d3ff356..4b1ec2cdaa 100644 --- a/test/passing/tests/labeled_tuple_patterns.ml.js-ref +++ b/test/passing/tests/labeled_tuple_patterns.ml.js-ref @@ -1,4 +1,4 @@ -(* This file is a copy of a labeled tuples test from the compiler. Not everything here +(* This file is a copy of a labeled tuples test from the compiler. Not everything here typechecks, but everything should parse. *) (* Test match statements with exception patterns *) diff --git a/test/passing/tests/labeled_tuples.ml.js-ref b/test/passing/tests/labeled_tuples.ml.js-ref index cd94542c96..21e6686234 100644 --- a/test/passing/tests/labeled_tuples.ml.js-ref +++ b/test/passing/tests/labeled_tuples.ml.js-ref @@ -1,9 +1,9 @@ (* This test file is just a copy of some of the compiler's labeled tuple tests as a - convenient source of examples. It include: + convenient source of examples. It include: - labeledtuples.ml - labeled_tuples_dsource.ml - - labeld_tuples_and_constructors.ml - Not everything here is expected to typecheck, but it should all parse. + - labeld_tuples_and_constructors.ml Not everything here is expected to typecheck, but + it should all parse. *) (* Basic expressions *) @@ -24,8 +24,8 @@ let (x : int * y:int) = ~x:1, 2 (* Happy case *) let foo b = if b then ~a:"s", 10, ~c:"hi" else ~a:"5", 10, ~c:"hi" -(* Missing label (the type vars in the error aren't ideal, but the same thing - happens when unifying normal tuples of different lengths) *) +(* Missing label (the type vars in the error aren't ideal, but the same thing happens when + unifying normal tuples of different lengths) *) let foo b = if b then ~a:"s", 10, "hi" else ~a:"5", 10, ~c:"hi" (* Missing labeled component *) @@ -74,11 +74,9 @@ let z = ~x, ~(y : string) let z = ~(x : int), ~y:"baz" let z = ~(x : string), ~y:"baz" -(* Take a [a:'a * b:'a] and an int, and returns a - [swapped:[a:'a * b:'a] * same:bool]. - The swapped component is the input with the [a] and [b] components swapped - as many times as the input int. The second component is whether the first - equals the input. *) +(* Take a [a:'a * b:'a] and an int, and returns a [swapped:[a:'a * b:'a] * same:bool]. The + swapped component is the input with the [a] and [b] components swapped as many times as + the input int. The second component is whether the first equals the input. *) let rec swap (~a, ~b) = function | 0 -> ~swapped:(~a, ~b), ~same:true | n -> swap' (~a:b, ~b:a) (n - 1) @@ -242,15 +240,15 @@ type ('a, 'b) pair = Pair of 'a * 'b let x = Pair (~x:5, 2) -(* Labeled tuple pattern in constructor pattern, with the same arity as the - constructor. This is intentionally disallowed. *) +(* Labeled tuple pattern in constructor pattern, with the same arity as the constructor. + This is intentionally disallowed. *) let f = function | Pair (~x:5, 2) -> true | _ -> false ;; -(* Labeled tuple patterns in constructor patterns with that can union with the - constructor pattern type. *) +(* Labeled tuple patterns in constructor patterns with that can union with the constructor + pattern type. *) let f = function | Some (~x:5, 2) -> true | _ -> false diff --git a/test/passing/tests/labeled_tuples_cmts_attrs.ml.js-ref b/test/passing/tests/labeled_tuples_cmts_attrs.ml.js-ref index f253b54faa..a97ff62dcb 100644 --- a/test/passing/tests/labeled_tuples_cmts_attrs.ml.js-ref +++ b/test/passing/tests/labeled_tuples_cmts_attrs.ml.js-ref @@ -1,7 +1,7 @@ (* Tests making sure comments and attributes are handled reasonably by labeled tuple - printing. This test has examples where the comments stay in exactly the same place - + printing. This test has examples where the comments stay in exactly the same place - see [labeled_tuples_cmts_attrs_move.ml] for examples where we allow ourselves to - slightly shift a comment or add a pun. *) + slightly shift a comment or add a pun. *) (* Attrs around expressions *) let y = ~z, ~z:(z [@attr]) diff --git a/test/passing/tests/labeled_tuples_cmts_attrs_move.ml.js-ref b/test/passing/tests/labeled_tuples_cmts_attrs_move.ml.js-ref index f80dfcb2f6..5dfba39758 100644 --- a/test/passing/tests/labeled_tuples_cmts_attrs_move.ml.js-ref +++ b/test/passing/tests/labeled_tuples_cmts_attrs_move.ml.js-ref @@ -1,7 +1,7 @@ (* Tests making sure comments and attributes are handled reasonably by labeled tuple - printing. This test has where we allow ourselves to slightly move a comment or add a - pun or parens that aren't strictly necessary. These examples are all analagous to - similar cases with other forms (e.g., labeled arguments). See + printing. This test has where we allow ourselves to slightly move a comment or add a + pun or parens that aren't strictly necessary. These examples are all analagous to + similar cases with other forms (e.g., labeled arguments). See [labeled_tuples_cmts_attrs.ml] for examples that stay exactly the same after formatting. *) diff --git a/test/passing/tests/labeled_tuples_regressions.ml.js-ref b/test/passing/tests/labeled_tuples_regressions.ml.js-ref index d58747bdb5..4a5660db7d 100644 --- a/test/passing/tests/labeled_tuples_regressions.ml.js-ref +++ b/test/passing/tests/labeled_tuples_regressions.ml.js-ref @@ -71,8 +71,8 @@ let bar = , ~p:(assert true) ) ;; -(* Labeled tuples in function return positions: Parens are needed iff - the first element is labeled AND the return is `local_` *) +(* Labeled tuples in function return positions: Parens are needed iff the first element is + labeled AND the return is `local_` *) module type S = sig val t1 : unit -> int * y:bool val t2 : unit -> local_ int * y:bool diff --git a/test/passing/tests/layout_abbreviation.ml.js-ref b/test/passing/tests/layout_abbreviation.ml.js-ref index f099198d4f..c272e4e050 100644 --- a/test/passing/tests/layout_abbreviation.ml.js-ref +++ b/test/passing/tests/layout_abbreviation.ml.js-ref @@ -1149,7 +1149,140 @@ module _ = struct (* CR-someday layouts: The line below doesn't stabilize in the [ocamlformat] profile *) - (* kind_abbrev_ k = ((kind_of_ (1* 422 *1) (1* 423 *1) tttttttttttttttttt (1* 421 *1) & ((1* 426 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 425 *1) mod (1* 427 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 428 *1) mmmmmmmmmmmmmmm (1* 424 *1)) & ((1* 429 *1) kkkkkkkkkkkkkkk & ((1* 433 *1) _ (1* 432 *1) (1* 431 *1) with (1* 434 *1) ((1* 435 *1) tttttttttttt, (1* 436 *1) ((1* 437 *1) ttttttttttttt, (1* 438 *1) ((1* 439 *1) ttttttttttttttttt, (1* 440 *1) t, (1* 441 *1) tttttttttttttttttttttttttttt, (1* 442 *1) ttttttttttttttttttttttt) (1* 443 *1) tttttt) (1* 444 *1) ttttttttttttttttttttt) (1* 445 *1) t (1* 430 *1)) & (((1* 450 *1) kkkkkkkkkkkkkkkkkkkkkkkkkk (1* 449 *1) mod (1* 451 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 452 *1) m (1* 453 *1) mmmmmm (1* 454 *1) mmmmmm (1* 455 *1) mmmmmmmmmmm (1* 448 *1)) (1* 447 *1) with (1* 456 *1) ttttttttttt (1* 446 *1)) & kind_of_ (1* 458 *1) (1* 459 *1) tttttttttttttttttttttttttttt (1* 457 *1) & (1* 461 *1) _ (1* 460 *1)) & (1* 463 *1) _ (1* 462 *1) & (((((1* 468 *1) kkkkkkkkkkkkkkkkkkkkk & ((1* 472 *1) _ (1* 471 *1) (1* 470 *1) with (1* 473 *1) ((1* 474 *1) tttttt, (1* 475 *1) ttttttttttttttttttttttttt) (1* 476 *1) tttttttttttttttttttttttttttttttt (1* 469 *1)) & (1* 478 *1) _ (1* 477 *1) & (kind_of_ (1* 482 *1) (1* 483 *1) tttttttt (1* 481 *1) (1* 480 *1) with (1* 484 *1) tttttt * (1* 485 *1) tttttttttttttttttttttttt * (1* 486 *1) t * (1* 487 *1) ttttttttttttttttttttttttt (1* 479 *1)) & ((((1* 490 *1) kkkkkkkkkkkkkk & (kind_of_ (1* 494 *1) (1* 495 *1) ttttttttttttttt (1* 493 *1) (1* 492 *1) mod (1* 496 *1) mmmmmmmmmmmmmmmmmmmmm (1* 497 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 498 *1) mmmmmmmmmmm (1* 491 *1)) & (((1* 503 *1) kkkk (1* 502 *1) with (('(1* 504 *1) aaaaaaaaaa : (1* 506 *1) _ (1* 505 *1)) -> (1* 507 *1) ttttttttttt) (1* 501 *1)) (1* 500 *1) mod (1* 508 *1) m (1* 509 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 510 *1) mmmmmmmmmmmmmmmmmmmmmmmmm (1* 499 *1)) & (((1* 515 *1) kkkkkkk (1* 514 *1) mod (1* 516 *1) mmmmmmmmm (1* 517 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 513 *1)) (1* 512 *1) with (1* 518 *1) ttttttttt (1* 511 *1)) & kind_of_ (1* 520 *1) (1* 521 *1) ((1* 522 *1) ttttttttttttttttttttttttttttttttttt) (1* 523 *1) tttttttttttttttttttttttttt (1* 519 *1)) & ((kind_of_ (1* 529 *1) (1* 530 *1) ttt (1* 528 *1) (1* 527 *1) mod (1* 531 *1) mmmmmmmmmmmmm (1* 532 *1) mmmmmmmmmmmmmmmmmmmmm (1* 533 *1) mmmmmmmmmmmmmmmmmmmmmmmm (1* 534 *1) mmmmmmmmmmmmmm (1* 526 *1)) (1* 525 *1) mod (1* 535 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 536 *1) mmmmmmmm (1* 524 *1)) & kind_of_ (1* 538 *1) (('(1* 539 *1) aaaaaaa : ((((((1* 545 *1) _ (1* 544 *1) & (1* 547 *1) _ (1* 546 *1) & ((((((1* 557 *1) _ (1* 556 *1) (1* 555 *1) mod (1* 558 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 559 *1) mmmmmmm (1* 560 *1) mmmmmmmmmmm (1* 561 *1) mmmmmmmmmmmmmm (1* 562 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 554 *1)) (1* 553 *1) mod (1* 563 *1) m (1* 564 *1) mmmmmm (1* 565 *1) mmmmmmmmm (1* 566 *1) mmmmmmmmmmmm (1* 552 *1)) (1* 551 *1) with (1* 567 *1) tttttttttttttt (1* 550 *1)) (1* 549 *1) with (1* 568 *1) tttttttttttttttttttttttttt (1* 548 *1)) & (1* 569 *1) kkkkkkkkkkkk & kind_of_ (1* 571 *1) ((1* 572 *1) tttttttttt -> (1* 573 *1) ttttttttttttttttttt) (1* 570 *1) & (1* 574 *1) kkkkkkkkkkkkkkkk))) (1* 543 *1) mod (1* 575 *1) mmm (1* 576 *1) mmmmmmmmm (1* 577 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 578 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 542 *1)) (1* 541 *1) mod (1* 579 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 580 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 581 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 582 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 583 *1) mmmmmmmmmmmmmmmmmmmmmmmmmm (1* 540 *1)))) -> (1* 584 *1) ttttttttttttttttttttt) (1* 537 *1) & ((((kind_of_ (1* 590 *1) (('(1* 591 *1) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa : (kind_of_ (1* 593 *1) (1* 594 *1) tttttt (1* 592 *1) & (((1* 598 *1) _ (1* 597 *1) & (((1* 604 *1) _ (1* 603 *1) (1* 602 *1) mod (1* 605 *1) mmmmmmmmmm (1* 606 *1) mmmmmmmmmmmmmmmmmmmmmmmmm (1* 607 *1) mmmm (1* 601 *1)) (1* 600 *1) with (1* 608 *1) tttttttttttttttt (1* 599 *1))) (1* 596 *1) mod (1* 609 *1) mmmmmmmmmmm (1* 595 *1)) & ((((1* 614 *1) kkkkk & kind_of_ (1* 616 *1) (1* 617 *1) ttttttttttttttttttttttttttttttttttt (1* 615 *1)) (1* 613 *1) with (1* 618 *1) tttttttttttttttttt (1* 612 *1)) (1* 611 *1) mod (1* 619 *1) mmmmmmmmmm (1* 620 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 621 *1) mmmmmmm (1* 622 *1) m (1* 623 *1) m (1* 610 *1)))) -> (1* 624 *1) t) (1* 589 *1)) & (1* 626 *1) _ (1* 625 *1) & (1* 627 *1) kkkkkk & (1* 629 *1) _ (1* 628 *1)) (1* 588 *1) mod (1* 630 *1) mmmmmmmmmmmmm (1* 631 *1) mmmmmm (1* 587 *1)) (1* 586 *1) mod (1* 632 *1) mmmmmmmmmm (1* 633 *1) mmmmmmmm (1* 634 *1) mmmmmmmmmmmmmmm (1* 635 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 636 *1) mmmmmmmmmmmmmmmmmmmmm (1* 585 *1)) & (((1* 639 *1) kkkkkkkkk (1* 638 *1) mod (1* 640 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 637 *1)) & ((((1* 643 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk & kind_of_ (1* 645 *1) (1* 646 *1) tt (1* 644 *1) & ((((((1* 656 *1) _ (1* 655 *1) & (((1* 661 *1) kkkkkkkkkkkkkkkkk (1* 660 *1) mod (1* 662 *1) mmmmmmm (1* 659 *1)) (1* 658 *1) with (1* 663 *1) ttttttttttttt (1* 657 *1)) & (1* 665 *1) _ (1* 664 *1) & kind_of_ (1* 667 *1) (1* 668 *1) ttttttttttttttttttttt (1* 666 *1)) (1* 654 *1) mod (1* 669 *1) mmmm (1* 670 *1) mmmmmmmmmmmm (1* 671 *1) mmmmmmmmmmmmmmmmmm (1* 672 *1) mmmmmmmmmmmmmmmmmmmmmm (1* 673 *1) mmmmmmmmmmmmmm (1* 653 *1)) (1* 652 *1) with (1* 674 *1) tt (1* 651 *1)) (1* 650 *1) mod (1* 675 *1) m (1* 676 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 677 *1) mmmmmmmmmmm (1* 678 *1) mmmmmmmmmmmmmmmmmmmmmmmmm (1* 649 *1)) (1* 648 *1) with (1* 679 *1) tttttttttttttttttttttttttttttttt (1* 647 *1)) & ((1* 681 *1) _ (1* 680 *1) & (((1* 687 *1) _ (1* 686 *1) (1* 685 *1) with (1* 688 *1) tttttttttttttttttttttttttttttttttt (1* 684 *1)) (1* 683 *1) with (1* 689 *1) ttttttttttttttttttttttt (1* 682 *1)) & kind_of_ (1* 691 *1) (1* 692 *1) ttt (1* 690 *1))) (1* 642 *1) with (1* 693 *1) tttttttttttttttttttttttttttttt (1* 641 *1)) & ((1* 697 *1) _ (1* 696 *1) (1* 695 *1) with (1* 698 *1) ttttttttttttttttttttttttt (1* 694 *1)) & (((1* 700 *1) _ (1* 699 *1)) & (((1* 704 *1) _ (1* 703 *1) (1* 702 *1) with (('(1* 705 *1) aaaaaaaaaaaaaaaaaaaaaaaaaa : ((1* 708 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 707 *1) mod (1* 709 *1) mmm (1* 710 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 711 *1) mmmmmmmmmmmmmm (1* 706 *1))) -> (1* 712 *1) t) (1* 701 *1)) & ((((1* 719 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 718 *1) with (1* 720 *1) ttttttttttt * (1* 721 *1) tttttttttttttttt * ((1* 722 *1) ttttttttttttt -> (1* 723 *1) tttttttttttttttttttttt) * (1* 724 *1) tttt * (1* 725 *1) ttttttttttttttttt (1* 717 *1)) (1* 716 *1) mod (1* 726 *1) mmmm (1* 727 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 728 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 715 *1)) (1* 714 *1) mod (1* 729 *1) mmmmmmmmmmmmmmmmmmm (1* 713 *1))) & ((1* 732 *1) k (1* 731 *1) mod (1* 733 *1) mmmmmmmmmm (1* 730 *1))) & (1* 734 *1) k & ((1* 735 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk & kind_of_ (1* 737 *1) (1* 738 *1) tttttttttttttttttt (1* 736 *1) & (1* 739 *1) k & ((kind_of_ (1* 743 *1) (1* 744 *1) t (1* 742 *1) (1* 741 *1) with (1* 745 *1) tttt (1* 740 *1)) & ((1* 748 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 747 *1) mod (1* 749 *1) mmmmmmmmmmmmmmmmmmmmmm (1* 750 *1) mmm (1* 746 *1)) & (((1* 756 *1) _ (1* 755 *1) (1* 754 *1) mod (1* 757 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 758 *1) mmmmmmmmmmmmmmmmmm (1* 759 *1) mmmmmmmmmmmmmmmmmmmmmm (1* 760 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 761 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 753 *1)) (1* 752 *1) with (1* 762 *1) tttttttttttttt * (1* 763 *1) t * (1* 764 *1) tttttttttttt * (1* 765 *1) ttttttttttt * (1* 766 *1) tttttttttttttttt (1* 751 *1)) & (1* 767 *1) kkkkkkkk & kind_of_ (1* 769 *1) (1* 770 *1) ttttttttttttttt (1* 768 *1)) & ((1* 773 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 772 *1) with (1* 774 *1) t (1* 771 *1)))) & (1* 775 *1) k & (((((((((((1* 793 *1) _ (1* 792 *1)) & ((1* 795 *1) _ (1* 794 *1)) & (1* 796 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkk & (1* 798 *1) _ (1* 797 *1)) (1* 791 *1) mod (1* 799 *1) mmmmmmmmmmmmmmmmmmmmmm (1* 790 *1)) (1* 789 *1) mod (1* 800 *1) mmmmmmmm (1* 801 *1) mmmmmm (1* 788 *1)) (1* 787 *1) with (1* 802 *1) tttttttttt * (1* 803 *1) ttttttttttttttttttttttttttt * (1* 804 *1) ((1* 805 *1) tttttttttttttttttttttttttttttt, (1* 806 *1) ttttttttttttttttttttttttttttt) (1* 807 *1) tttttttttt * (('(1* 808 *1) aaaaa : (kind_of_ (1* 810 *1) ((1* 811 *1) tttttttttttttttttttttttttttttt -> (1* 812 *1) ttttttttttttttttttttttttttttt) (1* 809 *1) & kind_of_ (1* 814 *1) (1* 815 *1) ((1* 816 *1) t, (1* 817 *1) ttttt, (1* 818 *1) tt, (1* 819 *1) tttttttttt) (1* 820 *1) tttttttttt (1* 813 *1) & (1* 821 *1) kkkkkkkkkkkkkkkkkkkkkkk & ((((1* 826 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 825 *1) mod (1* 827 *1) mmmmmmmmmmmmmmmm (1* 828 *1) m (1* 824 *1))) (1* 823 *1) mod (1* 829 *1) mmmmmmmmmmmmmm (1* 830 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 831 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 822 *1)) & (kind_of_ (1* 835 *1) (1* 836 *1) tttt (1* 834 *1) (1* 833 *1) with (1* 837 *1) ttt (1* 832 *1)))) -> (1* 838 *1) ttttttttttttttttttttttttttttttttt) (1* 786 *1)) (1* 785 *1) mod (1* 839 *1) mmmmmmmmmmmmmmm (1* 840 *1) mmmmmmmmmmmmmm (1* 841 *1) mmmmmmmmmmmmmmmmmmmmmmmmm (1* 784 *1)) (1* 783 *1) with (1* 842 *1) tttttttttttt (1* 782 *1)) (1* 781 *1) mod (1* 843 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 780 *1)) (1* 779 *1) with (1* 844 *1) t (1* 778 *1)) (1* 777 *1) mod (1* 845 *1) mmm (1* 846 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 847 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 776 *1)))) (1* 489 *1) with ((1* 848 *1) ttttttttttttttttttttttttttttttt -> (1* 849 *1) ttttttttttttttttttttt) (1* 488 *1))) (1* 467 *1) mod (1* 850 *1) mmmmmmmmmmmmmmmmm (1* 851 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 852 *1) mmmmmmmmmmmmmm (1* 853 *1) mmmmmmmmmm (1* 466 *1)) (1* 465 *1) mod (1* 854 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 855 *1) m (1* 856 *1) mmmmmmmmm (1* 857 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 464 *1)) & (1* 858 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk & kind_of_ (1* 860 *1) (1* 861 *1) tttttttttttttttttttttttttttttt (1* 859 *1) & kind_of_ (1* 863 *1) (1* 864 *1) ttttttttttttttttttttttttttttttttttt (1* 862 *1) & kind_of_ (1* 866 *1) (1* 867 *1) ((1* 868 *1) tttttttttttttttttttttttttttttttttt) (1* 869 *1) tttttttttttttttttttttttttttttttttt * (1* 870 *1) ((1* 871 *1) ttttttttttttttttttttttttttttttttttt) (1* 872 *1) tttt (1* 865 *1))) (1* 420 *1) mod (1* 873 *1) mmmmmmmmmmmmm (1* 874 *1) mmm (1* 875 *1) mm (1* 876 *1) mmmmmmmmmmm (1* 419 *1)) *) + (* kind_abbrev_ k = ((kind_of_ (1* 422 *1) (1* 423 *1) tttttttttttttttttt (1* 421 *1) & + ((1* 426 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 425 *1) mod (1* 427 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 428 *1) mmmmmmmmmmmmmmm (1* 424 *1)) & ((1* + 429 *1) kkkkkkkkkkkkkkk & ((1* 433 *1) _ (1* 432 *1) (1* 431 *1) with (1* 434 *1) + ((1* 435 *1) tttttttttttt, (1* 436 *1) ((1* 437 *1) ttttttttttttt, (1* 438 *1) ((1* + 439 *1) ttttttttttttttttt, (1* 440 *1) t, (1* 441 *1) tttttttttttttttttttttttttttt, + (1* 442 *1) ttttttttttttttttttttttt) (1* 443 *1) tttttt) (1* 444 *1) + ttttttttttttttttttttt) (1* 445 *1) t (1* 430 *1)) & (((1* 450 *1) + kkkkkkkkkkkkkkkkkkkkkkkkkk (1* 449 *1) mod (1* 451 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* + 452 *1) m (1* 453 *1) mmmmmm (1* 454 *1) mmmmmm (1* 455 *1) mmmmmmmmmmm (1* 448 *1)) + (1* 447 *1) with (1* 456 *1) ttttttttttt (1* 446 *1)) & kind_of_ (1* 458 *1) (1* + 459 *1) tttttttttttttttttttttttttttt (1* 457 *1) & (1* 461 *1) _ (1* 460 *1)) & (1* + 463 *1) _ (1* 462 *1) & (((((1* 468 *1) kkkkkkkkkkkkkkkkkkkkk & ((1* 472 *1) _ (1* + 471 *1) (1* 470 *1) with (1* 473 *1) ((1* 474 *1) tttttt, (1* 475 *1) + ttttttttttttttttttttttttt) (1* 476 *1) tttttttttttttttttttttttttttttttt (1* 469 *1)) + & (1* 478 *1) _ (1* 477 *1) & (kind_of_ (1* 482 *1) (1* 483 *1) tttttttt (1* 481 *1) + (1* 480 *1) with (1* 484 *1) tttttt * (1* 485 *1) tttttttttttttttttttttttt * (1* + 486 *1) t * (1* 487 *1) ttttttttttttttttttttttttt (1* 479 *1)) & ((((1* 490 *1) + kkkkkkkkkkkkkk & (kind_of_ (1* 494 *1) (1* 495 *1) ttttttttttttttt (1* 493 *1) (1* + 492 *1) mod (1* 496 *1) mmmmmmmmmmmmmmmmmmmmm (1* 497 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 498 *1) mmmmmmmmmmm (1* 491 *1)) & (((1* + 503 *1) kkkk (1* 502 *1) with (('(1* 504 *1) aaaaaaaaaa : (1* 506 *1) _ (1* 505 *1)) + -> (1* 507 *1) ttttttttttt) (1* 501 *1)) (1* 500 *1) mod (1* 508 *1) m (1* 509 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 510 *1) mmmmmmmmmmmmmmmmmmmmmmmmm (1* 499 *1)) & + (((1* 515 *1) kkkkkkk (1* 514 *1) mod (1* 516 *1) mmmmmmmmm (1* 517 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 513 *1)) (1* 512 *1) with (1* 518 *1) ttttttttt + (1* 511 *1)) & kind_of_ (1* 520 *1) (1* 521 *1) ((1* 522 *1) + ttttttttttttttttttttttttttttttttttt) (1* 523 *1) tttttttttttttttttttttttttt (1* + 519 *1)) & ((kind_of_ (1* 529 *1) (1* 530 *1) ttt (1* 528 *1) (1* 527 *1) mod (1* + 531 *1) mmmmmmmmmmmmm (1* 532 *1) mmmmmmmmmmmmmmmmmmmmm (1* 533 *1) + mmmmmmmmmmmmmmmmmmmmmmmm (1* 534 *1) mmmmmmmmmmmmmm (1* 526 *1)) (1* 525 *1) mod (1* + 535 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 536 *1) mmmmmmmm (1* 524 *1)) & kind_of_ (1* + 538 *1) (('(1* 539 *1) aaaaaaa : ((((((1* 545 *1) _ (1* 544 *1) & (1* 547 *1) _ (1* + 546 *1) & ((((((1* 557 *1) _ (1* 556 *1) (1* 555 *1) mod (1* 558 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 559 *1) mmmmmmm (1* 560 *1) mmmmmmmmmmm (1* + 561 *1) mmmmmmmmmmmmmm (1* 562 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 554 *1)) (1* + 553 *1) mod (1* 563 *1) m (1* 564 *1) mmmmmm (1* 565 *1) mmmmmmmmm (1* 566 *1) + mmmmmmmmmmmm (1* 552 *1)) (1* 551 *1) with (1* 567 *1) tttttttttttttt (1* 550 *1)) + (1* 549 *1) with (1* 568 *1) tttttttttttttttttttttttttt (1* 548 *1)) & (1* 569 *1) + kkkkkkkkkkkk & kind_of_ (1* 571 *1) ((1* 572 *1) tttttttttt -> (1* 573 *1) + ttttttttttttttttttt) (1* 570 *1) & (1* 574 *1) kkkkkkkkkkkkkkkk))) (1* 543 *1) mod + (1* 575 *1) mmm (1* 576 *1) mmmmmmmmm (1* 577 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* + 578 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 542 *1)) (1* 541 *1) mod (1* 579 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 580 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm + (1* 581 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 582 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 583 *1) mmmmmmmmmmmmmmmmmmmmmmmmmm (1* + 540 *1)))) -> (1* 584 *1) ttttttttttttttttttttt) (1* 537 *1) & ((((kind_of_ (1* + 590 *1) (('(1* 591 *1) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa : (kind_of_ (1* 593 *1) + (1* 594 *1) tttttt (1* 592 *1) & (((1* 598 *1) _ (1* 597 *1) & (((1* 604 *1) _ (1* + 603 *1) (1* 602 *1) mod (1* 605 *1) mmmmmmmmmm (1* 606 *1) mmmmmmmmmmmmmmmmmmmmmmmmm + (1* 607 *1) mmmm (1* 601 *1)) (1* 600 *1) with (1* 608 *1) tttttttttttttttt (1* + 599 *1))) (1* 596 *1) mod (1* 609 *1) mmmmmmmmmmm (1* 595 *1)) & ((((1* 614 *1) kkkkk + & kind_of_ (1* 616 *1) (1* 617 *1) ttttttttttttttttttttttttttttttttttt (1* 615 *1)) + (1* 613 *1) with (1* 618 *1) tttttttttttttttttt (1* 612 *1)) (1* 611 *1) mod (1* + 619 *1) mmmmmmmmmm (1* 620 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 621 *1) mmmmmmm (1* + 622 *1) m (1* 623 *1) m (1* 610 *1)))) -> (1* 624 *1) t) (1* 589 *1)) & (1* 626 *1) _ + (1* 625 *1) & (1* 627 *1) kkkkkk & (1* 629 *1) _ (1* 628 *1)) (1* 588 *1) mod (1* + 630 *1) mmmmmmmmmmmmm (1* 631 *1) mmmmmm (1* 587 *1)) (1* 586 *1) mod (1* 632 *1) + mmmmmmmmmm (1* 633 *1) mmmmmmmm (1* 634 *1) mmmmmmmmmmmmmmm (1* 635 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 636 *1) mmmmmmmmmmmmmmmmmmmmm (1* 585 *1)) & + (((1* 639 *1) kkkkkkkkk (1* 638 *1) mod (1* 640 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 637 *1)) & ((((1* 643 *1) + kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk & kind_of_ (1* 645 *1) (1* 646 *1) tt (1* 644 *1) & + ((((((1* 656 *1) _ (1* 655 *1) & (((1* 661 *1) kkkkkkkkkkkkkkkkk (1* 660 *1) mod (1* + 662 *1) mmmmmmm (1* 659 *1)) (1* 658 *1) with (1* 663 *1) ttttttttttttt (1* 657 *1)) + & (1* 665 *1) _ (1* 664 *1) & kind_of_ (1* 667 *1) (1* 668 *1) ttttttttttttttttttttt + (1* 666 *1)) (1* 654 *1) mod (1* 669 *1) mmmm (1* 670 *1) mmmmmmmmmmmm (1* 671 *1) + mmmmmmmmmmmmmmmmmm (1* 672 *1) mmmmmmmmmmmmmmmmmmmmmm (1* 673 *1) mmmmmmmmmmmmmm (1* + 653 *1)) (1* 652 *1) with (1* 674 *1) tt (1* 651 *1)) (1* 650 *1) mod (1* 675 *1) m + (1* 676 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 677 *1) mmmmmmmmmmm (1* 678 *1) + mmmmmmmmmmmmmmmmmmmmmmmmm (1* 649 *1)) (1* 648 *1) with (1* 679 *1) + tttttttttttttttttttttttttttttttt (1* 647 *1)) & ((1* 681 *1) _ (1* 680 *1) & (((1* + 687 *1) _ (1* 686 *1) (1* 685 *1) with (1* 688 *1) tttttttttttttttttttttttttttttttttt + (1* 684 *1)) (1* 683 *1) with (1* 689 *1) ttttttttttttttttttttttt (1* 682 *1)) & + kind_of_ (1* 691 *1) (1* 692 *1) ttt (1* 690 *1))) (1* 642 *1) with (1* 693 *1) + tttttttttttttttttttttttttttttt (1* 641 *1)) & ((1* 697 *1) _ (1* 696 *1) (1* 695 *1) + with (1* 698 *1) ttttttttttttttttttttttttt (1* 694 *1)) & (((1* 700 *1) _ (1* + 699 *1)) & (((1* 704 *1) _ (1* 703 *1) (1* 702 *1) with (('(1* 705 *1) + aaaaaaaaaaaaaaaaaaaaaaaaaa : ((1* 708 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* + 707 *1) mod (1* 709 *1) mmm (1* 710 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* + 711 *1) mmmmmmmmmmmmmm (1* 706 *1))) -> (1* 712 *1) t) (1* 701 *1)) & ((((1* 719 *1) + kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 718 *1) with (1* 720 *1) ttttttttttt * (1* + 721 *1) tttttttttttttttt * ((1* 722 *1) ttttttttttttt -> (1* 723 *1) + tttttttttttttttttttttt) * (1* 724 *1) tttt * (1* 725 *1) ttttttttttttttttt (1* + 717 *1)) (1* 716 *1) mod (1* 726 *1) mmmm (1* 727 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* + 728 *1) mmmmmmmmmmmmmmmmmmmmmmm (1* 715 *1)) (1* 714 *1) mod (1* 729 *1) + mmmmmmmmmmmmmmmmmmm (1* 713 *1))) & ((1* 732 *1) k (1* 731 *1) mod (1* 733 *1) + mmmmmmmmmm (1* 730 *1))) & (1* 734 *1) k & ((1* 735 *1) + kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk & kind_of_ (1* 737 *1) (1* 738 *1) + tttttttttttttttttt (1* 736 *1) & (1* 739 *1) k & ((kind_of_ (1* 743 *1) (1* 744 *1) t + (1* 742 *1) (1* 741 *1) with (1* 745 *1) tttt (1* 740 *1)) & ((1* 748 *1) + kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 747 *1) mod (1* 749 *1) + mmmmmmmmmmmmmmmmmmmmmm (1* 750 *1) mmm (1* 746 *1)) & (((1* 756 *1) _ (1* 755 *1) (1* + 754 *1) mod (1* 757 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 758 *1) + mmmmmmmmmmmmmmmmmm (1* 759 *1) mmmmmmmmmmmmmmmmmmmmmm (1* 760 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 761 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* + 753 *1)) (1* 752 *1) with (1* 762 *1) tttttttttttttt * (1* 763 *1) t * (1* 764 *1) + tttttttttttt * (1* 765 *1) ttttttttttt * (1* 766 *1) tttttttttttttttt (1* 751 *1)) & + (1* 767 *1) kkkkkkkk & kind_of_ (1* 769 *1) (1* 770 *1) ttttttttttttttt (1* 768 *1)) + & ((1* 773 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 772 *1) with (1* 774 *1) t (1* + 771 *1)))) & (1* 775 *1) k & (((((((((((1* 793 *1) _ (1* 792 *1)) & ((1* 795 *1) _ + (1* 794 *1)) & (1* 796 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkk & (1* 798 *1) _ (1* 797 *1)) + (1* 791 *1) mod (1* 799 *1) mmmmmmmmmmmmmmmmmmmmmm (1* 790 *1)) (1* 789 *1) mod (1* + 800 *1) mmmmmmmm (1* 801 *1) mmmmmm (1* 788 *1)) (1* 787 *1) with (1* 802 *1) + tttttttttt * (1* 803 *1) ttttttttttttttttttttttttttt * (1* 804 *1) ((1* 805 *1) + tttttttttttttttttttttttttttttt, (1* 806 *1) ttttttttttttttttttttttttttttt) (1* + 807 *1) tttttttttt * (('(1* 808 *1) aaaaa : (kind_of_ (1* 810 *1) ((1* 811 *1) + tttttttttttttttttttttttttttttt -> (1* 812 *1) ttttttttttttttttttttttttttttt) (1* + 809 *1) & kind_of_ (1* 814 *1) (1* 815 *1) ((1* 816 *1) t, (1* 817 *1) ttttt, (1* + 818 *1) tt, (1* 819 *1) tttttttttt) (1* 820 *1) tttttttttt (1* 813 *1) & (1* 821 *1) + kkkkkkkkkkkkkkkkkkkkkkk & ((((1* 826 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 825 *1) + mod (1* 827 *1) mmmmmmmmmmmmmmmm (1* 828 *1) m (1* 824 *1))) (1* 823 *1) mod (1* + 829 *1) mmmmmmmmmmmmmm (1* 830 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 831 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 822 *1)) & (kind_of_ (1* 835 *1) (1* 836 *1) tttt + (1* 834 *1) (1* 833 *1) with (1* 837 *1) ttt (1* 832 *1)))) -> (1* 838 *1) + ttttttttttttttttttttttttttttttttt) (1* 786 *1)) (1* 785 *1) mod (1* 839 *1) + mmmmmmmmmmmmmmm (1* 840 *1) mmmmmmmmmmmmmm (1* 841 *1) mmmmmmmmmmmmmmmmmmmmmmmmm (1* + 784 *1)) (1* 783 *1) with (1* 842 *1) tttttttttttt (1* 782 *1)) (1* 781 *1) mod (1* + 843 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 780 *1)) (1* 779 *1) with (1* 844 *1) t + (1* 778 *1)) (1* 777 *1) mod (1* 845 *1) mmm (1* 846 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 847 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* + 776 *1)))) (1* 489 *1) with ((1* 848 *1) ttttttttttttttttttttttttttttttt -> (1* + 849 *1) ttttttttttttttttttttt) (1* 488 *1))) (1* 467 *1) mod (1* 850 *1) + mmmmmmmmmmmmmmmmm (1* 851 *1) mmmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 852 *1) mmmmmmmmmmmmmm + (1* 853 *1) mmmmmmmmmm (1* 466 *1)) (1* 465 *1) mod (1* 854 *1) + mmmmmmmmmmmmmmmmmmmmmmmmmmm (1* 855 *1) m (1* 856 *1) mmmmmmmmm (1* 857 *1) + mmmmmmmmmmmmmmmmmmmmmmm (1* 464 *1)) & (1* 858 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk + & kind_of_ (1* 860 *1) (1* 861 *1) tttttttttttttttttttttttttttttt (1* 859 *1) & + kind_of_ (1* 863 *1) (1* 864 *1) ttttttttttttttttttttttttttttttttttt (1* 862 *1) & + kind_of_ (1* 866 *1) (1* 867 *1) ((1* 868 *1) tttttttttttttttttttttttttttttttttt) (1* + 869 *1) tttttttttttttttttttttttttttttttttt * (1* 870 *1) ((1* 871 *1) + ttttttttttttttttttttttttttttttttttt) (1* 872 *1) tttt (1* 865 *1))) (1* 420 *1) mod + (1* 873 *1) mmmmmmmmmmmmm (1* 874 *1) mmm (1* 875 *1) mm (1* 876 *1) mmmmmmmmmmm (1* + 419 *1)) *) kind_abbrev_ k = kind_of_ (* 880 *) @@ -2342,7 +2475,17 @@ module type S = sig (* CR-someday layouts: The line below doesn't stabilize in the [ocamlformat] profile *) - (* kind_abbrev_ k = (((((1* 1479 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 1478 *1) mod (1* 1480 *1) mmmmmmmmmmmmmmmmmmmmmmmm (1* 1477 *1)) (1* 1476 *1) with (('(1* 1481 *1) aaaaaaaaaaaaaaaaaaaaaaa : (kind_of_ (1* 1485 *1) (1* 1486 *1) ((1* 1487 *1) ttttttttttttttttttttttttt, ((1* 1488 *1) ttttttttttttttttttttttttttt -> (1* 1489 *1) ttttttttttttttttttttttttttt)) (1* 1490 *1) ttttttttt (1* 1484 *1) (1* 1483 *1) mod (1* 1491 *1) mmmmmmmmmmmmmmmmm (1* 1492 *1) mmmm (1* 1493 *1) mmmmmm (1* 1482 *1))) -> (1* 1494 *1) tttttttttttttt) (1* 1475 *1)) (1* 1474 *1) with (1* 1495 *1) t (1* 1473 *1)) & (1* 1496 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk & (1* 1498 *1) _ (1* 1497 *1) & kind_of_ (1* 1500 *1) (('(1* 1501 *1) aaaaaaaaaaaaaaa : kind_of_ (1* 1503 *1) (1* 1504 *1) ttttttttttttttttt (1* 1502 *1)) -> (1* 1505 *1) ttttttttttttttttttttttttttttttttttt) (1* 1499 *1)) *) + (* kind_abbrev_ k = (((((1* 1479 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkk (1* 1478 *1) mod (1* + 1480 *1) mmmmmmmmmmmmmmmmmmmmmmmm (1* 1477 *1)) (1* 1476 *1) with (('(1* 1481 *1) + aaaaaaaaaaaaaaaaaaaaaaa : (kind_of_ (1* 1485 *1) (1* 1486 *1) ((1* 1487 *1) + ttttttttttttttttttttttttt, ((1* 1488 *1) ttttttttttttttttttttttttttt -> (1* 1489 *1) + ttttttttttttttttttttttttttt)) (1* 1490 *1) ttttttttt (1* 1484 *1) (1* 1483 *1) mod + (1* 1491 *1) mmmmmmmmmmmmmmmmm (1* 1492 *1) mmmm (1* 1493 *1) mmmmmm (1* 1482 *1))) + -> (1* 1494 *1) tttttttttttttt) (1* 1475 *1)) (1* 1474 *1) with (1* 1495 *1) t (1* + 1473 *1)) & (1* 1496 *1) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk & (1* 1498 *1) _ (1* + 1497 *1) & kind_of_ (1* 1500 *1) (('(1* 1501 *1) aaaaaaaaaaaaaaa : kind_of_ (1* + 1503 *1) (1* 1504 *1) ttttttttttttttttt (1* 1502 *1)) -> (1* 1505 *1) + ttttttttttttttttttttttttttttttttttt) (1* 1499 *1)) *) kind_abbrev_ k = (* 1510 *) kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk diff --git a/test/passing/tests/layout_annotation.ml.js-ref b/test/passing/tests/layout_annotation.ml.js-ref index b06d2bcb75..139dbb24a7 100644 --- a/test/passing/tests/layout_annotation.ml.js-ref +++ b/test/passing/tests/layout_annotation.ml.js-ref @@ -123,10 +123,9 @@ type ('a : immediate) t_imm type s = { f : ('a : value). 'a -> 'a u } and 'a u = 'a t_imm -(* CR layouts v1.5: the location on that message is wrong. But it's hard to - improve, because it comes from re-checking typedtree, where we don't have - locations any more. I conjecture the same location problem exists when - constraints aren't satisfied. *) +(* CR layouts v1.5: the location on that message is wrong. But it's hard to improve, + because it comes from re-checking typedtree, where we don't have locations any more. I + conjecture the same location problem exists when constraints aren't satisfied. *) (********************) (* Test 5: newtypes *) diff --git a/test/passing/tests/layout_annotation_mod.ml.js-ref b/test/passing/tests/layout_annotation_mod.ml.js-ref index 15ebcd0a13..594e2ddf6e 100644 --- a/test/passing/tests/layout_annotation_mod.ml.js-ref +++ b/test/passing/tests/layout_annotation_mod.ml.js-ref @@ -107,10 +107,9 @@ type ('a : immediate mod mode) t_imm type s = { f : ('a : value mod mode). 'a -> 'a u } and 'a u = 'a t_imm -(* CR layouts v1.5: the location on that message is wrong. But it's hard to - improve, because it comes from re-checking typedtree, where we don't have - locations any more. I conjecture the same location problem exists when - constraints aren't satisfied. *) +(* CR layouts v1.5: the location on that message is wrong. But it's hard to improve, + because it comes from re-checking typedtree, where we don't have locations any more. I + conjecture the same location problem exists when constraints aren't satisfied. *) (********************) (* Test 5: newtypes *) diff --git a/test/passing/tests/layout_annotation_with.ml.js-ref b/test/passing/tests/layout_annotation_with.ml.js-ref index 077a923013..7ef260053c 100644 --- a/test/passing/tests/layout_annotation_with.ml.js-ref +++ b/test/passing/tests/layout_annotation_with.ml.js-ref @@ -107,10 +107,9 @@ type ('a : immediate with type_) t_imm type s = { f : ('a : value with type_). 'a -> 'a u } and 'a u = 'a t_imm -(* CR layouts v1.5: the location on that message is wrong. But it's hard to - improve, because it comes from re-checking typedtree, where we don't have - locations any more. I conjecture the same location problem exists when - constraints aren't satisfied. *) +(* CR layouts v1.5: the location on that message is wrong. But it's hard to improve, + because it comes from re-checking typedtree, where we don't have locations any more. I + conjecture the same location problem exists when constraints aren't satisfied. *) (********************) (* Test 5: newtypes *) diff --git a/test/passing/tests/let_binding-in_indent.ml.js-ref b/test/passing/tests/let_binding-in_indent.ml.js-ref index bd7d7a5c51..b4e196a7c2 100644 --- a/test/passing/tests/let_binding-in_indent.ml.js-ref +++ b/test/passing/tests/let_binding-in_indent.ml.js-ref @@ -1,5 +1,12 @@ -(* Note that {[ let ident : typ = exp ]} is different from {[ let (ident : - typ) = exp ]}. The difference should be maintained *) +(* Note that + {[ + let ident : typ = exp + ]} + is different from + {[ + let (ident : typ) = exp + ]} + . The difference should be maintained *) let (_ : int) = x1 let (x : int) = x2 diff --git a/test/passing/tests/let_binding-indent.ml.js-ref b/test/passing/tests/let_binding-indent.ml.js-ref index bd7d7a5c51..b4e196a7c2 100644 --- a/test/passing/tests/let_binding-indent.ml.js-ref +++ b/test/passing/tests/let_binding-indent.ml.js-ref @@ -1,5 +1,12 @@ -(* Note that {[ let ident : typ = exp ]} is different from {[ let (ident : - typ) = exp ]}. The difference should be maintained *) +(* Note that + {[ + let ident : typ = exp + ]} + is different from + {[ + let (ident : typ) = exp + ]} + . The difference should be maintained *) let (_ : int) = x1 let (x : int) = x2 diff --git a/test/passing/tests/let_binding.ml.js-ref b/test/passing/tests/let_binding.ml.js-ref index bd7d7a5c51..b4e196a7c2 100644 --- a/test/passing/tests/let_binding.ml.js-ref +++ b/test/passing/tests/let_binding.ml.js-ref @@ -1,5 +1,12 @@ -(* Note that {[ let ident : typ = exp ]} is different from {[ let (ident : - typ) = exp ]}. The difference should be maintained *) +(* Note that + {[ + let ident : typ = exp + ]} + is different from + {[ + let (ident : typ) = exp + ]} + . The difference should be maintained *) let (_ : int) = x1 let (x : int) = x2 diff --git a/test/passing/tests/local.ml.js-ref b/test/passing/tests/local.ml.js-ref index a8c0e046e6..9dab9840cb 100644 --- a/test/passing/tests/local.ml.js-ref +++ b/test/passing/tests/local.ml.js-ref @@ -110,8 +110,8 @@ let x = ;; module type S = functor (_ : S) (_ : S) -> S -(* this is here to make sure we pass the AST equality checks even when the - extended AST is different *) +(* this is here to make sure we pass the AST equality checks even when the extended AST is + different *) let f (local_ (* a *) diff --git a/test/passing/tests/modality_comments_regression.mli.js-ref b/test/passing/tests/modality_comments_regression.mli.js-ref index b1946c89f3..c579821409 100644 --- a/test/passing/tests/modality_comments_regression.mli.js-ref +++ b/test/passing/tests/modality_comments_regression.mli.js-ref @@ -3,7 +3,7 @@ mm mmmmm mmmmmmmmm - (* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*) + (* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx *) mmmmmmmmmm mmmmmmmmmm @@ -14,7 +14,7 @@ val command mmmmm mmmmm mmmmmm - (* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*) + (* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx *) mmmmmmm mmmmmmmm mmmmmmmm diff --git a/test/passing/tests/modes.ml.js-ref b/test/passing/tests/modes.ml.js-ref index 68c864f1ec..f518b117a7 100644 --- a/test/passing/tests/modes.ml.js-ref +++ b/test/passing/tests/modes.ml.js-ref @@ -1,13 +1,13 @@ -(* The first half of this file tests basic formatting of the [@]-based mode syntax - in various positions to make sure we are able to handle them all, and that - they are correctly parenthesized. The second half more thoroughly checks - formatting when there are line breaks in various positions. *) +(* The first half of this file tests basic formatting of the [@]-based mode syntax in + various positions to make sure we are able to handle them all, and that they are + correctly parenthesized. The second half more thoroughly checks formatting when there + are line breaks in various positions. *) (* Modes on arbitrary patterns were supported in the parser during development of - ocamlformat support for modes, but were later unsupported in the parser. Tests of - modes on patterns have thus been moved to [test/failing/tests/modes_on_patterns.ml]. - If patterns are ever again supported in the parser, move those tests back to this - file (and other [modes*.ml] files in this directory). *) + ocamlformat support for modes, but were later unsupported in the parser. Tests of modes + on patterns have thus been moved to [test/failing/tests/modes_on_patterns.ml]. If + patterns are ever again supported in the parser, move those tests back to this file + (and other [modes*.ml] files in this directory). *) module Let_bindings = struct let x @ mode = y diff --git a/test/passing/tests/modes_cmts.ml.js-ref b/test/passing/tests/modes_cmts.ml.js-ref index 23c1914c9e..6adb7ad7e1 100644 --- a/test/passing/tests/modes_cmts.ml.js-ref +++ b/test/passing/tests/modes_cmts.ml.js-ref @@ -1,6 +1,5 @@ -(* Check that comments are not dropped or moved in unusual ways. - A few commented out tests where comments move have explanations, and are - tested in [modes_cmts_move.ml]. *) +(* Check that comments are not dropped or moved in unusual ways. A few commented out tests + where comments move have explanations, and are tested in [modes_cmts_move.ml]. *) (* let bindings *) @@ -265,8 +264,8 @@ type t = | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 (* cmt *) @ m6) @@ m7 m8 -> t | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 @ (* cmt *) m6) @@ m7 m8 -> t | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 @ m6 (* cmt *)) @@ m7 m8 -> t - (* Comment moves between [@@] and [m7]: - | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 @ m6) (* cmt *) @@ m7 m8 -> t *) + (* Comment moves between [@@] and [m7]: | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 + @ m6) (* cmt *) @@ m7 m8 -> t *) | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 @ m6) @@ (* cmt *) m7 m8 -> t | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 @ m6) @@ m7 (* cmt *) m8 -> t | A : t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 @ m6) @@ m7 m8 (* cmt *) -> t @@ -291,8 +290,8 @@ end (* let-bound functions *) -(* Comment moves to between [(] and [f]: - let (* cmt *) (f @ mode1) (arg1 @ mode2) (arg2 @ mode3) : typ = x *) +(* Comment moves to between [(] and [f]: let (* cmt *) (f @ mode1) (arg1 @ mode2) (arg2 @ + mode3) : typ = x *) let ((* cmt *) f @ mode1) (arg1 @ mode2) (arg2 @ mode3) : typ = x let (f (* cmt *) @ mode1) (arg1 @ mode2) (arg2 @ mode3) : typ = x @@ -309,7 +308,7 @@ let (f @ mode1) (arg1 @ mode2) (arg2 (* cmt *) @ mode3) : typ = x let (f @ mode1) (arg1 @ mode2) (arg2 @ (* cmt *) mode3) : typ = x let (f @ mode1) (arg1 @ mode2) (arg2 @ mode3 (* cmt *)) : typ = x -(* Comment moves to after [=], but not because of modes: - let (f @ mode1) (arg1 @ mode2) (arg2 @ mode3) (* cmt *) : typ = x *) +(* Comment moves to after [=], but not because of modes: let (f @ mode1) (arg1 @ mode2) + (arg2 @ mode3) (* cmt *) : typ = x *) let (f @ mode1) (arg1 @ mode2) (arg2 @ mode3) : (* cmt *) typ = x diff --git a/test/passing/tests/modes_cmts_move.ml.js-ref b/test/passing/tests/modes_cmts_move.ml.js-ref index a00e3f0dc8..f93911b97c 100644 --- a/test/passing/tests/modes_cmts_move.ml.js-ref +++ b/test/passing/tests/modes_cmts_move.ml.js-ref @@ -1,8 +1,8 @@ -(* This comment moves for similar reason to existing behavior as shown below. - In particular, the operator ([@@] / [->]) does not carry a source locaion, - and the comment attaches to the location of the identifier on the right side - of the operator rather than the left due to the parenthesis. Fixing this would - require messing with the comment association logic, which is difficult. *) +(* This comment moves for similar reason to existing behavior as shown below. In + particular, the operator ([@@] / [->]) does not carry a source locaion, and the comment + attaches to the location of the identifier on the right side of the operator rather + than the left due to the parenthesis. Fixing this would require messing with the + comment association logic, which is difficult. *) type t = A of t1 @@ m1 m2 * t2 @@ m3 m4 * (t3 @ m5 -> t4 @ m6) @@ (* cmt *) m7 m8 type t = A of (t -> u) @@ (* cmt *) m type t = A of ((t -> u) -> (* cmt *) m) diff --git a/test/passing/tests/module_type.ml.js-ref b/test/passing/tests/module_type.ml.js-ref index fc09f058b3..1493f2869a 100644 --- a/test/passing/tests/module_type.ml.js-ref +++ b/test/passing/tests/module_type.ml.js-ref @@ -25,12 +25,12 @@ end module type M = module type of M with module A := A - (*test*) + (* test *) and module A = A - (*test*) + (* test *) and module A = A with module A = A - (*test*) + (* test *) with module A = A module U : diff --git a/test/passing/tests/object.ml.js-ref b/test/passing/tests/object.ml.js-ref index 8164ff6639..08b2a062e3 100644 --- a/test/passing/tests/object.ml.js-ref +++ b/test/passing/tests/object.ml.js-ref @@ -226,8 +226,7 @@ end y = yet another value>} ;; -{<(* check: e is effectively the index associated with e, and check that - already in *) +{<(* check: e is effectively the index associated with e, and check that already in *) x = y>} class type a = b[@attr] diff --git a/test/passing/tests/ocp_indent_compat-break_colon_after.ml.js-ref b/test/passing/tests/ocp_indent_compat-break_colon_after.ml.js-ref index 4634ba061b..2062dce4a8 100644 --- a/test/passing/tests/ocp_indent_compat-break_colon_after.ml.js-ref +++ b/test/passing/tests/ocp_indent_compat-break_colon_after.ml.js-ref @@ -14,8 +14,8 @@ module type M = sig : (Location.t -> Env.t -> Longident.t -> Path.t) ref val transl_modtype_longident - (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo - foooooooooooooo foooooooooooo *) + (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo foooooooooooooo + foooooooooooo *) : (Location.t -> Env.t -> Longident.t -> Path.t) ref val imported_sets_of_closures_table diff --git a/test/passing/tests/ocp_indent_compat.ml.js-ref b/test/passing/tests/ocp_indent_compat.ml.js-ref index 4634ba061b..2062dce4a8 100644 --- a/test/passing/tests/ocp_indent_compat.ml.js-ref +++ b/test/passing/tests/ocp_indent_compat.ml.js-ref @@ -14,8 +14,8 @@ module type M = sig : (Location.t -> Env.t -> Longident.t -> Path.t) ref val transl_modtype_longident - (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo - foooooooooooooo foooooooooooo *) + (* foooooooooo fooooooooooooo foooooooooooo foooooooooooooo foooooooooooooo + foooooooooooo *) : (Location.t -> Env.t -> Longident.t -> Path.t) ref val imported_sets_of_closures_table diff --git a/test/passing/tests/print_config.ml.err b/test/passing/tests/print_config.ml.err index 7fa13d32b5..04aed07bc1 100644 --- a/test/passing/tests/print_config.ml.err +++ b/test/passing/tests/print_config.ml.err @@ -67,5 +67,6 @@ stritem-extension-indent=0 (profile ocamlformat (file tests/.ocamlformat:1)) type-decl=compact (profile ocamlformat (file tests/.ocamlformat:1)) type-decl-indent=2 (profile ocamlformat (file tests/.ocamlformat:1)) wrap-comments=true (file tests/.ocamlformat:5) +preserve-ambiguous-line-comment=false (profile ocamlformat (file tests/.ocamlformat:1)) wrap-fun-args=true (profile ocamlformat (file tests/.ocamlformat:1)) profile=ocamlformat (file tests/.ocamlformat:1) diff --git a/test/passing/tests/protected_object_types.ml.js-ref b/test/passing/tests/protected_object_types.ml.js-ref index b415c6e4f0..4d056f63bd 100644 --- a/test/passing/tests/protected_object_types.ml.js-ref +++ b/test/passing/tests/protected_object_types.ml.js-ref @@ -1,8 +1,8 @@ (* Tests of special cases added to avoid emitting [>\] and [>\}], which are keywords. *) -(* Regression tests for https://github.com/ocaml-ppx/ocamlformat/issues/1295 - (unnecessary trailing spaces added after object types with attributes). *) +(* Regression tests for https://github.com/ocaml-ppx/ocamlformat/issues/1295 (unnecessary + trailing spaces added after object types with attributes). *) type t = { foo : (< .. >[@a]) } type t = { foo : < .. > [@a] } @@ -34,9 +34,8 @@ module Space_around = struct end module Inside_payloads = struct - (* Regression tests for - https://github.com/ocaml-ppx/ocamlformat/issues/1267 (failure to protect - against object types inside extension and attribute payloads). *) + (* Regression tests for https://github.com/ocaml-ppx/ocamlformat/issues/1267 (failure to + protect against object types inside extension and attribute payloads). *) let _ = [%ext: < .. > ] diff --git a/test/passing/tests/record_punning.ml.js-ref b/test/passing/tests/record_punning.ml.js-ref index dc07fd4c13..8c06fb9ac8 100644 --- a/test/passing/tests/record_punning.ml.js-ref +++ b/test/passing/tests/record_punning.ml.js-ref @@ -17,10 +17,10 @@ let d = { x = x [@foo] } let e = { x = y } let { x } = f let deep = { x; y = { x } } -let x = { (*test*) aaa : aa; bbb : bb } +let x = { (* test *) aaa : aa; bbb : bb } let x = { aaa : aa (* A *); bbb : bb } let x = { aaa : aa; (* A *) bbb : bb } -let x = { (*test*) aaa : aa = aa; bbb : bb } +let x = { (* test *) aaa : aa = aa; bbb : bb } let x = { aaa : aa (* A *) = aa; bbb : bb } let x = { aaa : aa = (* A *) aa; bbb : bb } let x = { aaa : aa; (* A *) bbb : bb } diff --git a/test/passing/tests/source.ml.js-ref b/test/passing/tests/source.ml.js-ref index 2e65cfe6c5..586cf596c7 100644 --- a/test/passing/tests/source.ml.js-ref +++ b/test/passing/tests/source.ml.js-ref @@ -248,7 +248,7 @@ class type castable = object method cast : 'a. 'a name -> 'a end -(* Lets create a castable class with a name*) +(* Lets create a castable class with a name *) class type foo_t = object inherit castable @@ -915,8 +915,7 @@ let g (type t) (x : t) (tag : t ty) = | Int -> x > 0 ;; -(* Error: This expression has type bool but an expression was expected of type -t = int *) +(* Error: This expression has type bool but an expression was expected of type t = int *) let id x = x @@ -1503,8 +1502,8 @@ let rec length : type a n. (a, n) seq -> n nat = function | Scons (_, s) -> NS (length s) ;; -(* app returns the catenated lists with a witness proving that - the size is the sum of its two inputs *) +(* app returns the catenated lists with a witness proving that the size is the sum of its + two inputs *) type (_, _, _) app = App : ('a, 'p) seq * ('n, 'm, 'p) plus -> ('a, 'n, 'm) app let rec app : type a n m. (a, n) seq -> (a, m) seq -> (a, n, m) app = @@ -1653,15 +1652,9 @@ let smaller : type a b. (a succ, b succ) le -> (a, b) le = function type (_, _) diff = Diff : 'c nat * ('a, 'c, 'b) plus -> ('a, 'b) diff -(* - let rec diff : type a b. (a,b) le -> a nat -> b nat -> (a,b) diff = - fun le a b -> - match a, b, le with - | NZ, m, _ -> Diff (m, PlusZ m) - | NS x, NZ, _ -> assert false - | NS x, NS y, q -> - match diff (smaller q) x y with Diff (m, p) -> Diff (m, PlusS p) -;; +(* let rec diff : type a b. (a,b) le -> a nat -> b nat -> (a,b) diff = fun le a b -> match + a, b, le with | NZ, m, _ -> Diff (m, PlusZ m) | NS x, NZ, _ -> assert false | NS x, NS + y, q -> match diff (smaller q) x y with Diff (m, p) -> Diff (m, PlusS p) ;; *) let rec diff : type a b. (a, b) le -> a nat -> b nat -> (a, b) diff = @@ -2093,8 +2086,8 @@ let v3 = eval_lam env0 ex3 (* 5.13: Constructing typing derivations at runtime *) -(* Modified slightly to use the language of 5.10, since this is more fun. - Of course this works also with the language of 5.12. *) +(* Modified slightly to use the language of 5.10, since this is more fun. Of course this + works also with the language of 5.12. *) type _ rep = | I : int rep @@ -2847,10 +2840,8 @@ type _ fin = | FZ : 'a succ fin | FS : 'a fin -> 'a succ fin -(* We cannot define - val empty : zero fin -> 'a - because we cannot write an empty pattern matching. - This might be useful to have *) +(* We cannot define val empty : zero fin -> 'a because we cannot write an empty pattern + matching. This might be useful to have *) (* In place, prove that the parameter is 'a succ *) type _ is_succ = IS : 'a succ is_succ @@ -2877,8 +2868,7 @@ let rec pre_subst f = function ;; let comp_subst f g (x : 'a fin) = pre_subst f (g x) -(* val comp_subst : - ('b fin -> 'c term) -> ('a fin -> 'b term) -> 'a fin -> 'c term *) +(* val comp_subst : ('b fin -> 'c term) -> ('a fin -> 'b term) -> 'a fin -> 'c term *) (* 4 The Occur-Check, through thick and thin *) @@ -2973,7 +2963,7 @@ let rec sub' : type m. m ealist -> m fin -> m term = function ;; let subst' d = pre_subst (sub' d) -(* val subst' : 'a ealist -> 'a term -> 'a term *) +(* val subst' : 'a ealist -> 'a term -> 'a term *) (* 6 First-Order Unification *) @@ -3221,9 +3211,9 @@ let test_bar () = val test_bar : unit -> unit = |}] -(* Uncomment these to test. Should see substantial speedup! -let () = Printf.printf "No @@immediate: %fs\n" (test test_foo) -let () = Printf.printf "With @@immediate: %fs\n" (test test_bar) *) +(* Uncomment these to test. Should see substantial speedup! let () = Printf.printf "No + @@immediate: %fs\n" (test test_foo) let () = Printf.printf "With @@immediate: %fs\n" + (test test_bar) *) (* INVALID DECLARATIONS *) @@ -4631,21 +4621,15 @@ module M' : module type of Std'.M = Std2.M let f3 (x : M'.t) : Std2.M.t = x -(* original report required Core_kernel: -module type S = sig -open Core_kernel.Std +(* original report required Core_kernel: module type S = sig open Core_kernel.Std -module Hashtbl1 : module type of Hashtbl -module Hashtbl2 : sig - include (module type of Hashtbl) -end + module Hashtbl1 : module type of Hashtbl module Hashtbl2 : sig include (module type of + Hashtbl) end -module Coverage : Core_kernel.Std.Hashable + module Coverage : Core_kernel.Std.Hashable -type types = unit constraint 'a Coverage.Table.t = (Coverage.t, 'a) Hashtbl1.t -type doesnt_type = unit - constraint 'a Coverage.Table.t = (Coverage.t, 'a) Hashtbl2.t -end + type types = unit constraint 'a Coverage.Table.t = (Coverage.t, 'a) Hashtbl1.t type + doesnt_type = unit constraint 'a Coverage.Table.t = (Coverage.t, 'a) Hashtbl2.t end *) module type INCLUDING = sig include module type of List @@ -4812,21 +4796,12 @@ module type PR6513 = sig S with type u = < foo : Html5.uri > end -(* Requires -package tyxml -module type PR6513_orig = sig -module type S = -sig - type t - type u -end +(* Requires -package tyxml module type PR6513_orig = sig module type S = sig type t type u + end -module Make: functor (Html5: Html5_sigs.T - with type 'a Xml.wrap = 'a and - type 'a wrap = 'a and - type 'a list_wrap = 'a list) - -> S with type t = Html5_types.div Html5.elt and - type u = < foo: Html5.uri > -end + module Make: functor (Html5: Html5_sigs.T with type 'a Xml.wrap = 'a and type 'a wrap = + 'a and type 'a list_wrap = 'a list) -> S with type t = Html5_types.div Html5.elt and + type u = < foo: Html5.uri > end *) module type S = sig include Set.S @@ -4955,7 +4930,7 @@ module X = struct end end -(* open X (* works! *) *) +(* open X (* works! *) *) module Y = X.Y type 'a arg_t = 'at constraint 'a = (module Y.S with type t = 'at) @@ -5032,10 +5007,8 @@ struct let uniq (type a b) (Eq : a fix) (Eq : b fix) : (a, b) eq = Eq end -(* This would allow: -module FixId = Fix (struct type 'a f = 'a end) - let bad : (int, string) eq = FixId.uniq Eq Eq - let _ = Printf.printf "Oh dear: %s" (cast bad 42) +(* This would allow: module FixId = Fix (struct type 'a f = 'a end) let bad : (int, + string) eq = FixId.uniq Eq Eq let _ = Printf.printf "Oh dear: %s" (cast bad 42) *) module M = struct module type S = sig @@ -5618,8 +5591,7 @@ struct end module G = F (M.Y) -(*module N = G (M);; -module N = F (M.Y) (M);;*) +(* module N = G (M);; module N = F (M.Y) (M);; *) (* PR#6307 *) @@ -5677,17 +5649,14 @@ end (* fail *) -(* (* if the above succeeded, one could break invariants *) -module rec M2 : S' = M2;; (* should succeed! (but this is bad) *) +(* (* if the above succeeded, one could break invariants *) module rec M2 : S' = M2;; (* + should succeed! (but this is bad) *) -let M2.W eq = W Eq;; + let M2.W eq = W Eq;; -let s = List.fold_right SInt.add [1;2;3] SInt.empty;; -module SInt2 = Set.Make(Int2);; -let conv : type a b. (a,b) eq -> a -> b = fun Eq x -> x;; -let s' : SInt2.t = conv eq s;; -SInt2.elements s';; -SInt2.mem 2 s';; (* invariants are broken *) + let s = List.fold_right SInt.add [1;2;3] SInt.empty;; module SInt2 = Set.Make(Int2);; + let conv : type a b. (a,b) eq -> a -> b = fun Eq x -> x;; let s' : SInt2.t = conv eq + s;; SInt2.elements s';; SInt2.mem 2 s';; (* invariants are broken *) *) (* Check behavior with submodules *) @@ -5870,15 +5839,13 @@ end = struct include A end -(* The following introduces a (useless) dependency on A: -module C : sig module L : module type of List end = A +(* The following introduces a (useless) dependency on A: module C : sig module L : module + type of List end = A *) include D' -(* - let () = - print_endline (string_of_int D'.M.y) +(* let () = print_endline (string_of_int D'.M.y) *) open A @@ -5891,8 +5858,8 @@ end = struct include A end -(* The following introduces a (useless) dependency on A: -module C : sig module L : module type of List end = A +(* The following introduces a (useless) dependency on A: module C : sig module L : module + type of List end = A *) (* No dependency on D *) @@ -5912,8 +5879,7 @@ module type S' = sig type u = bool end -(* ok to convert between structurally equal signatures, and parameters - are inferred *) +(* ok to convert between structurally equal signatures, and parameters are inferred *) let f (x : (module S with type t = 'a and type u = 'b)) : (module S') = x let g x = (x : (module S with type t = 'a and type u = 'b) :> (module S')) @@ -6499,10 +6465,7 @@ module M : sig end = struct type refer = { poly : 'a 'b 'c. (('b, 'c) #Classdef.cl2 as 'a) } end -(* - ocamlc -c pr3918a.mli pr3918b.mli - rm -f pr3918a.cmi - ocamlc -c pr3918c.ml +(* ocamlc -c pr3918a.mli pr3918b.mli rm -f pr3918a.cmi ocamlc -c pr3918c.ml *) open Pr3918b @@ -6898,8 +6861,8 @@ let f Test2.A = () let a = Test2.A (* fail *) -(* The following should fail from a semantical point of view, - but allow it for backward compatibility *) +(* The following should fail from a semantical point of view, but allow it for backward + compatibility *) module Test2 : module type of Test with type t = private Test.t = Test (* PR#6331 *) @@ -7129,8 +7092,7 @@ module PR_4450_2 = struct end end -(* A synthetic example of bootstrapped data structure - (suggested by J-C Filliatre) *) +(* A synthetic example of bootstrapped data structure (suggested by J-C Filliatre) *) module type ORD = sig type t @@ -7381,11 +7343,7 @@ let _ = (* Early strict evaluation *) -(* - module rec Cyclic - : sig val x : int end - = struct let x = Cyclic.x + 1 end -;; +(* module rec Cyclic : sig val x : int end = struct let x = Cyclic.x + 1 end ;; *) (* Reordering of evaluation based on dependencies *) @@ -7478,19 +7436,16 @@ end (* Wrong LHS signatures (PR#4336) *) -(* - module type ASig = sig type a val a:a val print:a -> unit end -module type BSig = sig type b val b:b val print:b -> unit end +(* module type ASig = sig type a val a:a val print:a -> unit end module type BSig = sig + type b val b:b val print:b -> unit end -module A = struct type a = int let a = 0 let print = print_int end -module B = struct type b = float let b = 0.0 let print = print_float end + module A = struct type a = int let a = 0 let print = print_int end module B = struct + type b = float let b = 0.0 let print = print_float end -module MakeA (Empty:sig end) : ASig = A -module MakeB (Empty:sig end) : BSig = B + module MakeA (Empty:sig end) : ASig = A module MakeB (Empty:sig end) : BSig = B -module - rec NewA : ASig = MakeA (struct end) - and NewB : BSig with type b = NewA.a = MakeB (struct end);; + module rec NewA : ASig = MakeA (struct end) and NewB : BSig with type b = NewA.a = + MakeB (struct end);; *) (* Expressions and bindings *) @@ -8190,8 +8145,8 @@ module M2 = struct type v = A.B.t end -(* Adapted from: An Expressive Language of Signatures - by Norman Ramsey, Kathleen Fisher and Paul Govereau *) +(* Adapted from: An Expressive Language of Signatures by Norman Ramsey, Kathleen Fisher + and Paul Govereau *) module type VALUE = sig type value (* a Lua value *) @@ -8542,8 +8497,8 @@ external i : (int -> float[@unboxed]) = "i" "i_nat" (* Bad: unboxing a "deep" sub-type. *) external j : int -> (float[@unboxed]) * float = "j" "j_nat" -(* This should be rejected, but it is quite complicated to do - in the current state of things *) +(* This should be rejected, but it is quite complicated to do in the current state of + things *) external k : int -> (float[@unboxd]) = "k" "k_nat" @@ -8623,7 +8578,7 @@ let f | _, _, _, _, _, _, _, G, _, _ -> 1 ;; -(*| _ -> _ *) +(* | _ -> _ *) (* Unused cases *) let f (x : int t) = @@ -8946,7 +8901,7 @@ end (* fails for -principal *) -(* Use type information with modules*) +(* Use type information with modules *) module M = struct type t = { x : int } type u = { x : bool } @@ -9661,13 +9616,7 @@ let _ = long_function_name long_argument_name__________________________________________) ;; -let g = - f - ~x - (* this is a multiple-line-spanning - comment *) - ~y -;; +let g = f ~x (* this is a multiple-line-spanning comment *) ~y let formula_base x = let open Formula.Infix in @@ -9686,9 +9635,7 @@ f let f = very_long_function_name - ~x:very_long_variable_name - (* this is a multiple-line-spanning - comment *) + ~x:very_long_variable_name (* this is a multiple-line-spanning comment *) ~y ;; @@ -9729,7 +9676,7 @@ type t = (* Here is some verbatim formatted text: {v starting at column 7 - v}*) + v} *) } module Intro_sort = struct @@ -9745,7 +9692,7 @@ module Intro_sort = struct 4-----o--------o--o--|-----o--4 | | | 5-----o--------------o-----o--5 - v} *) + v} *) foooooooooo fooooo fooo; foooooooooo fooooo fooo; foooooooooo fooooo fooo @@ -9761,11 +9708,10 @@ let _ = let nullsafe_optimistic_third_party_params_in_non_strict = CLOpt.mk_bool ~long:"nullsafe-optimistic-third-party-params-in-non-strict" - (* Turned on for compatibility reasons. Historically this is because - there was no actionable way to change third party annotations. Now - that we have such a support, this behavior should be reconsidered, - provided our tooling and error reporting is friendly enough to be - smoothly used by developers. *) + (* Turned on for compatibility reasons. Historically this is because there was no + actionable way to change third party annotations. Now that we have such a + support, this behavior should be reconsidered, provided our tooling and error + reporting is friendly enough to be smoothly used by developers. *) ~default:true "Nullsafe: in this mode we treat non annotated third party method params as if they \ were annotated as nullable." @@ -9780,8 +9726,7 @@ let foo () = ;; let xxxxxx = - let%map (* _____________________________ - __________ *) () = yyyyyyyy in + let%map (* _____________________________ __________ *) () = yyyyyyyy in { zzzzzzzzzzzzz } ;; @@ -9817,7 +9762,8 @@ let _ = ;; let[@a - (* .............................................. ........................... .......................... ...................... *) + (* .............................................. ........................... + .......................... ...................... *) foo (* ....................... *) (* ................................. *) @@ -10343,11 +10289,9 @@ type t = (* ____________________________________ *) } -(*{v - +(* {v foo - -v}*) + v} *) let _ = match () with @@ -10470,13 +10414,9 @@ let _ = (** xxxxxxxxxxxxxxxxxxxxxxxxxxx [xxxxxxx xxxx] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [xxxxxxx] *) -(* Hand-aligned comment - . - . *) +(* Hand-aligned comment . . *) -(* First line is indented more - . - . *) +(* First line is indented more . . *) module type M = sig val imported_sets_of_closures_table diff --git a/test/passing/tests/unboxed_records_cmts_attrs.ml.js-ref b/test/passing/tests/unboxed_records_cmts_attrs.ml.js-ref index 3f69939dfe..8724ee0764 100644 --- a/test/passing/tests/unboxed_records_cmts_attrs.ml.js-ref +++ b/test/passing/tests/unboxed_records_cmts_attrs.ml.js-ref @@ -1,5 +1,5 @@ -(* Tests making sure comments and attributes are handled reasonably by - unboxed record printing. *) +(* Tests making sure comments and attributes are handled reasonably by unboxed record + printing. *) (* Attrs around expressions *) let y = #{ a = z; b = z [@attr] } diff --git a/test/passing/tests/unboxed_tuples.ml.js-ref b/test/passing/tests/unboxed_tuples.ml.js-ref index 23deb02860..66f9c78a1c 100644 --- a/test/passing/tests/unboxed_tuples.ml.js-ref +++ b/test/passing/tests/unboxed_tuples.ml.js-ref @@ -1,6 +1,5 @@ -(* This test file is just a copy of labeled_tuples.ml and - labeled_tuples_regressions.ml, with less labels, and some additional - regression tests at the bottom. *) +(* This test file is just a copy of labeled_tuples.ml and labeled_tuples_regressions.ml, + with less labels, and some additional regression tests at the bottom. *) (* Basic expressions *) let x = #(1, 2) @@ -20,8 +19,8 @@ let (x : #(int * y:int)) = #(~x:1, 2) (* Happy case *) let foo b = if b then #(~a:"s", 10, ~c:"hi") else #(~a:"5", 10, ~c:"hi") -(* Missing label (the type vars in the error aren't ideal, but the same thing - happens when unifying normal tuples of different lengths) *) +(* Missing label (the type vars in the error aren't ideal, but the same thing happens when + unifying normal tuples of different lengths) *) let foo b = if b then #(~a:"s", 10, "hi") else #(~a:"5", 10, ~c:"hi") (* Missing labeled component *) @@ -70,10 +69,9 @@ let z = #(~x, ~(y : string)) let z = #(~(x : int), ~y:"baz") let z = #((x : string), ~y:"baz") -(* Take a [a:'a * b:'a] and an int, and returns a [swapped:[a:'a * b:'a] * - same:bool]. The swapped component is the input with the [a] and [b] - components swapped as many times as the input int. The second component is - whether the first equals the input. *) +(* Take a [a:'a * b:'a] and an int, and returns a [swapped:[a:'a * b:'a] * same:bool]. The + swapped component is the input with the [a] and [b] components swapped as many times as + the input int. The second component is whether the first equals the input. *) let rec swap #(~a, ~b) = function | 0 -> #(~swapped:#(~a, ~b), ~same:true) | n -> swap' #(~a:b, ~b:a) (n - 1) @@ -235,15 +233,15 @@ let #(~x:x0, ~s, ~(y : int), ..) : #(x:int * s:string * y:int * string) = type ('a, 'b) pair = Pair of 'a * 'b -(* Labeled tuple pattern in constructor pattern, with the same arity as the - constructor. This is intentionally disallowed. *) +(* Labeled tuple pattern in constructor pattern, with the same arity as the constructor. + This is intentionally disallowed. *) let f = function | Pair #(~x:5, 2) -> true | _ -> false ;; -(* Labeled tuple patterns in constructor patterns with that can union with - the constructor pattern type. *) +(* Labeled tuple patterns in constructor patterns with that can union with the constructor + pattern type. *) let f = function | Some #(~x:5, 2) -> true | _ -> false @@ -381,8 +379,8 @@ let bar = , assert true ) ;; -(* Labeled tuples in function return positions: Parens are needed iff the - first element is labeled AND the return is `local_` *) +(* Labeled tuples in function return positions: Parens are needed iff the first element is + labeled AND the return is `local_` *) module type S = sig val t1 : unit -> #(int * y:bool) val t2 : unit -> local_ #(int * y:bool) diff --git a/test/passing/tests/unboxed_tuples_cmts_attrs.ml.js-ref b/test/passing/tests/unboxed_tuples_cmts_attrs.ml.js-ref index 46ede288ba..560273b450 100644 --- a/test/passing/tests/unboxed_tuples_cmts_attrs.ml.js-ref +++ b/test/passing/tests/unboxed_tuples_cmts_attrs.ml.js-ref @@ -1,5 +1,5 @@ -(* Tests making sure comments and attributes are handled reasonably by - unboxed tuple printing. *) +(* Tests making sure comments and attributes are handled reasonably by unboxed tuple + printing. *) (* Attrs around expressions *) let y = #(z, (z [@attr])) diff --git a/test/passing/tests/unicode.ml.js-ref b/test/passing/tests/unicode.ml.js-ref index 67a75ead14..259de3b699 100644 --- a/test/passing/tests/unicode.ml.js-ref +++ b/test/passing/tests/unicode.ml.js-ref @@ -1,9 +1,9 @@ (* Don't edit this file with an editor that perform unicode normalization *) -(* normal78901234567890123456789012345678901234567890123456789012345678901 a bū c d e*) +(* normal78901234567890123456789012345678901234567890123456789012345678901 a bū c d e *) -(* modifier901234567890123456789012345678901234567890123456789012345678901 a bū̃ c d e*) +(* modifier901234567890123456789012345678901234567890123456789012345678901 a bū̃ c d e *) -(* 12345678901234567890123456789012345678901234567890123456789012345678901 a yo c d e*) +(* 12345678901234567890123456789012345678901234567890123456789012345678901 a yo c d e *) -(* 12345678901234567890123456789012345678901234567890123456789012345678901 a y̲o c d e*) +(* 12345678901234567890123456789012345678901234567890123456789012345678901 a y̲o c d e *) diff --git a/test/passing/tests/verbose1.ml.err b/test/passing/tests/verbose1.ml.err index 9671518f6e..f4988fc173 100644 --- a/test/passing/tests/verbose1.ml.err +++ b/test/passing/tests/verbose1.ml.err @@ -67,5 +67,6 @@ stritem-extension-indent=0 (profile ocamlformat (file tests/.ocamlformat:1)) type-decl=compact (profile ocamlformat (file tests/.ocamlformat:1)) type-decl-indent=2 (profile ocamlformat (file tests/.ocamlformat:1)) wrap-comments=true (file tests/.ocamlformat:5) +preserve-ambiguous-line-comment=false (profile ocamlformat (file tests/.ocamlformat:1)) wrap-fun-args=true (profile ocamlformat (file tests/.ocamlformat:1)) profile=ocamlformat (file tests/.ocamlformat:1) diff --git a/test/passing/tests/wrap_comments.ml.js-ref b/test/passing/tests/wrap_comments.ml.js-ref index 43c5803cc8..87ba9c9c3d 100644 --- a/test/passing/tests/wrap_comments.ml.js-ref +++ b/test/passing/tests/wrap_comments.ml.js-ref @@ -2,33 +2,31 @@ type t = | Aaaaaaaaaa - (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. *) + (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. *) | Bbbbbbbbbb let _ = [ "a" - ; "b" - (* first line - second line *) + ; "b" (* first line second line *) ; "c" (* first line - second line + second line *) ; "d" (* first line - - second line *) + second line *) ; "e" (* first line - second line + second line *) ; "f" (* first line - second line + second line *) ; "g" ] @@ -36,34 +34,29 @@ let _ = let _ = let _ = - (* This is indented 7 -This 0 *) + (* This is indented 7 This 0 *) 0 in 0 ;; let _ = - (*no space before - no space after*) + (* no space before no space after *) 0 ;; let _ = - (* - blah blah + (* blah blah *) () ;; (* - * foo + * foo * bar -*) + *) -(* - * foo - bar +(* * foo bar *) (* foo @@ -77,8 +70,8 @@ let _ = * *) module _ = struct - (* xxx = -xxx * xxxx.xxx + x * xxxx.xxx = -xxx * x + xx = -xxx - xxx = -xxx * xxxx.xxx + x * xxxx.xxx = -xxx * x + xx = -xx + (* xxx = -xxx * xxxx.xxx + x * xxxx.xxx = -xxx * x + xx = -xxx xxx = -xxx * xxxx.xxx + + x * xxxx.xxx = -xxx * x + xx = -xx *) end @@ -93,87 +86,85 @@ let _ = * + 2 * --- * 3 -*) + *) [@@@ocamlformat "wrap-comments=false"] type t = | Aaaaaaaaaa - (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. *) + (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor + incididunt ut labore et dolore magna aliqua. *) | Bbbbbbbbbb let rex = Pcre.regexp ("^[0-9]{2}" - (* xxxxxxxxxxx *) + (* xxxxxxxxxxx *) ^ "(.{12})" - (* xxxxxxxxxxxxxxxxxx *) + (* xxxxxxxxxxxxxxxxxx *) ^ "(.{4})" - (* xxxxxxxxxxxx *) + (* xxxxxxxxxxxx *) ^ "([0-9]{3})" - (* xxxxxxxx *) + (* xxxxxxxx *) ^ "(.{60})" - (* xxxxxxxxxxxxxxxxxxxx *) + (* xxxxxxxxxxxxxxxxxxxx *) ^ "(.{12})" - (* xxxxxxxxxxxxxxx *) + (* xxxxxxxxxxxxxxx *) ^ "(.{12})" - (* xxxxxxxxxxxxxxxxxxx *) + (* xxxxxxxxxxxxxxxxxxx *) ^ "([0-9]{3})" (* xxxxxxxxxxxxxxxxxxxxxxxxx *) ^ "([0-9]{3})" - (* xxxxxxxxxxx *) + (* xxxxxxxxxxx *) ^ "(.{15})" - (* xxxxxxxxxxxxxxxxxx *) + (* xxxxxxxxxxxxxxxxxx *) ^ "([0-9]{7})" - (* xxxxxxxxxxxxx *) + (* xxxxxxxxxxxxx *) ^ "(.{10})" - (* xxxxxxxxxxxxx *) + (* xxxxxxxxxxxxx *) ^ date_fmt - (* xxxxxxxxxxxxx *) + (* xxxxxxxxxxxxx *) ^ "([0-9]{18})" - (* xxxxx *) + (* xxxxx *) ^ "(.)" - (* xxxxxxxxxxx *) + (* xxxxxxxxxxx *) ^ "([0-9]{3})" - (* xxxxxxxxxxxxxx *) + (* xxxxxxxxxxxxxx *) ^ "(.{15})" - (* xxxxxxxxxxxxxxxxxxxx *) + (* xxxxxxxxxxxxxxxxxxxx *) ^ "(.{3})" - (* xxxxxxxxxx *) + (* xxxxxxxxxx *) ^ "(.{27})$") ;; type foo = { some_field : int (* long long long long long long long long long long long long long long - * long long long long *) + * long long long long *) ; another_field : string } let _ = [ "a" - ; "b" - (* first line - second line *) + ; "b" (* first line second line *) ; "c" (* first line - second line + second line *) ; "d" (* first line - - second line *) + second line *) ; "e" (* first line - second line + second line *) ; "f" (* first line - second line + second line *) ; "g" ] @@ -181,22 +172,19 @@ let _ = let _ = let _ = - (* This is indented 7 -This 0 *) + (* This is indented 7 This 0 *) 0 in 0 ;; let _ = - (*no space before - no space after*) + (* no space before no space after *) 0 ;; let _ = - (*no space before - just newline after + (* no space before just newline after *) 0 ;; @@ -214,25 +202,22 @@ let _ = 4-----o--------o--o--|-----o--4 | | | 5-----o--------------o-----o--5 - v} *) + v} *) () ;; let _ = - (* - blah blah + (* blah blah *) () ;; (* - * foo + * foo * bar -*) + *) -(* - * foo - bar +(* * foo bar *) let _ = @@ -284,4 +269,4 @@ let _ = * + 2 * --- * 3 -*) + *) diff --git a/vendor/odoc-parser/lexer.mll b/vendor/odoc-parser/lexer.mll index 41b679f0bc..a16a27b8a9 100644 --- a/vendor/odoc-parser/lexer.mll +++ b/vendor/odoc-parser/lexer.mll @@ -312,6 +312,9 @@ rule token input = parse { emit_numbered input `Paren num } | '(' ((['1'-'9'] ['0'-'9']*) as num) ')' { emit_numbered input `Two_paren num } + (* only parse [1] and friends, but not [a], [A] and friends *) + | '\\'? '[' ((['1'-'9'] ['0'-'9']*) as num) '\\'? ']' + { emit_numbered input `Two_brace num } | (['a'-'z'] as num) '.' { emit input (`List_number (`Dot, `Lower_case num)) } diff --git a/vendor/odoc-parser/odoc_parser.ml b/vendor/odoc-parser/odoc_parser.ml index 2d9fdd5de1..61ca2db16f 100644 --- a/vendor/odoc-parser/odoc_parser.ml +++ b/vendor/odoc-parser/odoc_parser.ml @@ -119,3 +119,24 @@ let parse_comment ~location ~text = (* Accessor functions, as [t] is opaque *) let warnings t = t.warnings let ast t = t.ast + +let tag_list = + [ "@author" + ; "@deprecated" + ; "@param" + ; "@raise" + ; "@raises" + ; "@return" + ; "@returns" + ; "@see" + ; "@see" + ; "@see" + ; "@since" + ; "@before" + ; "@version" + ; "@canonical" + ; "@inline" + ; "@open" + ; "@closed" + ] +;; diff --git a/vendor/odoc-parser/odoc_parser.mli b/vendor/odoc-parser/odoc_parser.mli index 5dbd4a0815..f5125eeb0e 100644 --- a/vendor/odoc-parser/odoc_parser.mli +++ b/vendor/odoc-parser/odoc_parser.mli @@ -44,3 +44,6 @@ val position_of_point : t -> Loc.point -> Lexing.position the usual representation in the Lexing module. Note that this relies on the information passed in {!parse_comment}, and hence requires the result of that call in addition to the {!Loc.point} being converted. *) + +val tag_list : string list +(** All valid odoc tags. *) diff --git a/vendor/odoc-parser/token.ml b/vendor/odoc-parser/token.ml index 09829cf142..9e88937bd0 100644 --- a/vendor/odoc-parser/token.ml +++ b/vendor/odoc-parser/token.ml @@ -5,7 +5,7 @@ type section_heading = [ `Begin_section_heading of int * string option ] type style = [ `Bold | `Italic | `Emphasis | `Superscript | `Subscript ] type paragraph_style = [ `Left | `Center | `Right ] -type list_punctuation = [ `Dot | `Paren | `Two_paren ] +type list_punctuation = [ `Dot | `Paren | `Two_paren | `Two_brace ] type list_number = [ `Number of int | `Lower_case of char | `Upper_case of char ] type tag = @@ -83,6 +83,7 @@ let print_list_number punc num = | `Dot -> "", "." | `Paren -> "", ")" | `Two_paren -> "(", ")" + | `Two_brace -> "[", "]" ) in let n =