Module Js_parser.Loc

type position = {
  1. line: int,
  2. column: int,
};
let equal_position: position => position => bool;
type t = {
  1. source: option(File_key.t),
  2. start: position,
  3. _end: position,
};
let none: t;
let is_none: t => bool;
let is_none_ignore_source: t => bool;
let btwn: t => t => t;
let char_before: t => t;
let first_char: t => t;
let contains: t => t => bool;

contains loc1 loc2 returns true if loc1 entirely overlaps loc2

let intersects: t => t => bool;

intersects loc1 loc2 returns true if loc1 intersects loc2 at all

let lines_intersect: t => t => bool;

lines_intersect loc1 loc2 returns true if loc1 and loc2 cover any part of the same line, even if they don't actually intersect.

For example, if loc1 ends and then loc2 begins later on the same line, intersects loc1 loc2 is false, but lines_intersect loc1 loc2 is true.

let pos_cmp: position => position => int;
let span_compare: t => t => int;
let compare_ignore_source: t => t => int;
let compare: t => t => int;
let equal: t => t => bool;
let debug_to_string: ?include_source:bool => t => string;
let to_string_no_source: t => string;
let mk_loc: ?source:File_key.t => (int, int) => (int, int) => t;
let source: t => option(File_key.t);
let cursor: option(File_key.t) => int => int => t;

Produces a zero-width Loc.t, where start = end

let start_loc: t => t;
let end_loc: t => t;