···284284 m "Failed to parse %s: %s" filename (Printexc.to_string exn));
285285 []
286286287287-let rec pp_expr ppf = function
288288- | If_then_else { cond; then_expr; else_expr } ->
289289- Fmt.pf ppf "If(%a, %a, %a)" pp_expr cond pp_expr then_expr
290290- (Fmt.option pp_expr) else_expr
291291- | Match { cases; _ } -> Fmt.pf ppf "Match(%d)" cases
292292- | Try { expr; handlers } -> Fmt.pf ppf "Try(%a, %d)" pp_expr expr handlers
293293- | Function { params; body } -> Fmt.pf ppf "Fun(%d, %a)" params pp_expr body
294294- | Let { bindings; body } ->
295295- Fmt.pf ppf "Let([%a], %a)"
296296- (Fmt.list ~sep:Fmt.comma (fun ppf (n, e) ->
297297- Fmt.pf ppf "%s=%a" n pp_expr e))
298298- bindings pp_expr body
299299- | Sequence exprs ->
300300- Fmt.pf ppf "Seq[%a]" (Fmt.list ~sep:Fmt.comma pp_expr) exprs
301301- | List -> Fmt.pf ppf "List"
302302- | Record { fields } -> Fmt.pf ppf "Record(%d)" fields
303303- | Other -> Fmt.pf ppf "Other"
304304-305287(** Standard functions for type t *)
306288let equal a b = a.functions = b.functions
307289
-3
lib/ast.mli
···7070 node. *)
7171end
72727373-val pp_expr : expr Fmt.t
7474-(** [pp_expr] pretty-prints an AST expression for debugging. *)
7575-7673val trailing_record_fields : expr -> int
7774(** [trailing_record_fields expr] returns the number of fields in a trailing
7875 record literal at the tail position of [expr]. Returns 0 if the expression
-3
lib/outline.ml
···1818 | Method
1919 | Label
20202121-type position = Merlin.position = { line : int; col : int }
2221type item = Merlin.outline_item
2322type t = Merlin.outline
2423···3433(* {2 Merlint-specific helpers} *)
35343635let pp = Merlin.pp_outline
3737-let pp_item = Merlin.pp_outline_item
3838-let pp_kind = Merlin.pp_symbol_kind
39364037let location filename (item : item) =
4138 let loc = item.location in
-9
lib/outline.mli
···1818 | Method
1919 | Label
20202121-type position = Merlin.position = { line : int; col : int }
2222-(** Position in file. *)
2323-2421type item = Merlin.outline_item
2522(** Outline item. *)
2623···52495350val pp : t Fmt.t
5451(** [pp] is a pretty-printer for outline. *)
5555-5656-val pp_item : item Fmt.t
5757-(** [pp_item] is a pretty-printer for outline item. *)
5858-5959-val pp_kind : kind Fmt.t
6060-(** [pp_kind] is a pretty-printer for symbol kind. *)
61526253val location : string -> item -> Location.t option
6354(** [location filename item] extracts location for merlint's Location.t. *)