stretch.mli 1020 Bytes
Newer Older
1
2
3
4
5
6
7
(* A stretch is a fragment of a source file. It holds the file name,
   the line number, and the line count (that is, the length) of the
   fragment. These are used for generating #line directives when the
   fragment is copied to an output file. It also holds the textual
   content of the fragment, as a string. The [raw_content] field holds
   the text that was found in the source file, while the [content]
   field holds the same text after transformation by the lexer (which
8
9
   may substitute keywords, insert padding, insert parentheses, etc.).
   See [Lexer.mk_stretch] and its various call sites in [Lexer]. *)
10
11
12
13
14
15
16

type t = {
    stretch_filename	: string;
    stretch_linenum	: int;
    stretch_linecount	: int;
    stretch_raw_content	: string;
    stretch_content	: string;
17
    stretch_keywords	: Keyword.keyword list
18
19
  } 

20
(* An OCaml type is either a stretch (if it was found in some
21
22
23
24
25
26
   source file) or a string (if it was inferred via [Infer]). *)

type ocamltype =
  | Declared of t
  | Inferred of string