2 * Copyright (c) 2015, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
11 * This is a simple data structure that allows querying for the docblock
12 * given a line in the source code. Rough description:
14 * 1. Find the last comment preceding the line of the definition.
15 * We also make sure this doesn't overlap with the preceding definition.
16 * If the last comment is more than 1 line away, it is ignored.
18 * 2. If the last comment is a block-style comment (/* */) just return it.
20 * 3. Otherwise (if it is a line style comment //) attempt to merge it with
21 * preceding line comments, if they exist.
22 * NOTE: We also enforce that line comments must be on the definition's
23 * immediately preceding line.
28 val make_docblock_finder
: ((Pos.t
* Prim_defs.comment
) list
) -> finder
30 val find_docblock
: finder
-> int -> int -> string option
32 (** Find the last comment on `line` if it exists. *)
33 val find_inline_comment
: finder
-> int -> string option
35 (** Returns the docblock for the passed in syntax node. *)
36 val get_docblock
: Full_fidelity_positioned_syntax.t
-> string option