Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamlformat 0.26.2 #142

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.20.1
version=0.26.2
profile=conventional
break-cases=fit-or-vertical
break-separators=before
Expand Down
4 changes: 2 additions & 2 deletions src/ohow/wiki_ext.ml
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ let do_unless_local _ _ _ c =
let open Operators in
`Flow5
(if not (Global.options ()).local
then c <$> Wiki_syntax.compile |? []
else [])
then c <$> Wiki_syntax.compile |? []
else [])

let init () =
Wiki_syntax.register_raw_wiki_extension ~name:"outline"
Expand Down
122 changes: 70 additions & 52 deletions src/ohow/wiki_syntax.ml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ let link_kind _bi addr =
in
Absolute
(let open Operators in
menu_page |? page)
menu_page |? page)
| "site" ->
let file = Global.current_file () in
let root = Global.root () in
Expand Down Expand Up @@ -254,19 +254,23 @@ open Wiki_syntax_types.ExtParser

(* cast ('a, 'b, 'c) ext_wikicreole_parser to 'a wikicreole_parser *)
let cast_wp (type a b c) wp =
let module P = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
(module P : Parser with type res = a)

(* cast ('a, 'b, 'c) ext_wikicreole_parser to 'b wikicreole_parser *)
let cast_niwp (type a b c) wp =
let module P = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
(module struct
type res = P.res_without_interactive
Expand All @@ -278,26 +282,32 @@ let cast_niwp (type a b c) wp =
with type res = b)

let get_plugin_resolver (type a b c) wp =
let module P = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
P.plugin_resolver

let preparse_string (type a b c) wp =
let module P = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
P.preparse_string

let desugar_string (type a b c) wp =
let module P = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module P =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
P.desugar_string

Expand Down Expand Up @@ -1138,14 +1148,14 @@ module FlowBuilder = struct
[ (Html.a
~a:
( (let open Operators in
(* NOTE address is always Some x for now but one could add another
case to the matching above in which the original address is to
be used. *)
address <$> (fun a -> Absolute a) |? addr)
(* NOTE address is always Some x for now but one could add another
case to the matching above in which the original address is to
be used. *)
address <$> (fun a -> Absolute a) |? addr)
|> uri_of_href |> Html.a_href
|> fun x -> x :: a )
(let open Operators in
text >>= (fun t -> Some [ Html.txt t ]) |? c)
text >>= (fun t -> Some [ Html.txt t ]) |? c)
:> Html_types.phrasing Html.elt)
]

Expand Down Expand Up @@ -1507,8 +1517,8 @@ end)
let wikicreole_parser_without_header_footer =
(module WikicreoleParserWithoutHeaderFooter : ExtParser
with type res = WikicreoleParserWithoutHeaderFooter.res
and type res_without_interactive = WikicreoleParserWithoutHeaderFooter
.res_without_interactive
and type res_without_interactive =
WikicreoleParserWithoutHeaderFooter.res_without_interactive
and type link_content = WikicreoleParserWithoutHeaderFooter.link_content)

(* Reduced parsers. *)
Expand Down Expand Up @@ -1582,22 +1592,22 @@ end)
let reduced_wikicreole_parser0 =
(module ReducedWikicreoleParser0 : ExtParser
with type res = ReducedWikicreoleParser0.res
and type res_without_interactive = ReducedWikicreoleParser0
.res_without_interactive
and type res_without_interactive =
ReducedWikicreoleParser0.res_without_interactive
and type link_content = ReducedWikicreoleParser0.link_content)

let reduced_wikicreole_parser1 =
(module ReducedWikicreoleParser1 : ExtParser
with type res = ReducedWikicreoleParser1.res
and type res_without_interactive = ReducedWikicreoleParser1
.res_without_interactive
and type res_without_interactive =
ReducedWikicreoleParser1.res_without_interactive
and type link_content = ReducedWikicreoleParser1.link_content)

let reduced_wikicreole_parser2 =
(module ReducedWikicreoleParser2 : ExtParser
with type res = ReducedWikicreoleParser2.res
and type res_without_interactive = ReducedWikicreoleParser2
.res_without_interactive
and type res_without_interactive =
ReducedWikicreoleParser2.res_without_interactive
and type link_content = ReducedWikicreoleParser2.link_content)

(* Phrasing parser. *)
Expand Down Expand Up @@ -1627,8 +1637,8 @@ end)
let phrasing_wikicreole_parser =
(module PhrasingWikicreoleParser : ExtParser
with type res = PhrasingWikicreoleParser.res
and type res_without_interactive = PhrasingWikicreoleParser
.res_without_interactive
and type res_without_interactive =
PhrasingWikicreoleParser.res_without_interactive
and type link_content = PhrasingWikicreoleParser.link_content)

(* Menu builder *)
Expand Down Expand Up @@ -1717,10 +1727,12 @@ type +'without_interactive link_simple_plugin =

let register_simple_extension (type a b c)
~(wp : (a, b, c) ext_wikicreole_parser) ~name ?preparser ?ni_plugin plugin =
let module Parser = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
let open Parser in
register_extension ~name ?preparser (SimplePlugin (plugin, ni_plugin))
Expand Down Expand Up @@ -1885,10 +1897,12 @@ type (-'content
let register_wiki_extension (type a b c a' b' c') ~wp ~name ~wp_rec ?preparser
?(context = fun bi _ -> bi) ?(ni_plugin : (_, _, _) wiki_plugin option)
(plugin : (_, _, _) wiki_plugin) =
let module Parser = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
let module Plugin = struct
type rec_res = a'
Expand Down Expand Up @@ -1919,10 +1933,12 @@ type (-'content

let register_link_extension (type a b c a' b' c') ~wp ~name ~wp_rec ?preparser
?(context = fun bi _ -> bi) (plugin : (_, _, _) link_plugin) =
let module Parser = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
let module Plugin = struct
type rec_res = a'
Expand All @@ -1938,10 +1954,12 @@ let register_link_extension (type a b c a' b' c') ~wp ~name ~wp_rec ?preparser

let register_raw_wiki_extension (type a b c a' b' c') ~wp ~name ~wp_rec
?preparser ?ni_plugin plugin =
let module Parser = (val wp : ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
let module Parser =
(val wp
: ExtParser
with type res = a
and type res_without_interactive = b
and type link_content = c)
in
let open Parser in
let module Plugin : RawWikiPlugin = struct
Expand Down
Loading