package reason

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t = {
  1. lnum_start : int;
  2. lnum_end : int;
}

t represents an interval, including endpoints, * delimited by two linenumbers.

val makeRangeBetween : Location.t -> Location.t -> t

* make a range delimited by loc1 and loc2 * 1| let a = 1; * 2| * 3| * 4| * 5| let b = 2; * If loc1 represents `let a = 1` and loc2 represents `let b = 2`, * we get the range: lnum_start: 2; lnum_end 4

val containsLoc : t -> Location.t -> bool

check whether range contains the loc

val containsWhitespace : ?comments:Comment.t list -> range:t -> unit -> bool

* checks if range contains whitespace. * When comments are passed, the computation * takes the height of the comments into account. * * Example: * 1| let a = 1; * 2| * 3| /* a multi- * 4| line comment */ * 5| let b = 1; * The range (line 2 - line 4) has whitespace. * * 1| let a = 1; * 2| /* a multi- * 3| line comment */ * 4| let b = 1; * The range (line 2 - line 3) does not have whitespace.

OCaml

Innovation. Community. Security.