Multiply entities beyond necessity even more (force better build parallelism)
[hiphop-php.git] / hphp / hack / src / parser / docblock_finder.mli
blob3c8cacb0c89aaac8739449f6736e84ad6ea000ed
1 (*
2 * Copyright (c) 2015, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 (**
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.
26 type finder
28 val make_docblock_finder : (Pos.t * Prim_defs.comment) list -> finder
30 val find_docblock : finder -> int -> int -> string option
32 val find_inline_comment : finder -> int -> string option
33 (** Find the last comment on `line` if it exists. *)
35 val get_docblock : Full_fidelity_positioned_syntax.t -> string option
36 (** Returns the docblock for the passed in syntax node. *)