package reason

  1. Overview
  2. Docs
Reason: Syntax & Toolchain for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

reason-3.17.2.tbz
sha256=7f4087016e8c393a13d57b7737677bc1dbf16978fd43c19354d4d79a794c8c47
sha512=3d3015d25bce329fbee9cef9b114831e7db1c10e19a26cbcaa27948c376bff3518b9d56fda9091c6df887df9ee8c33f45e1071e87933de79d65bcbf58c93cb17

doc/src/reason/reason_toolchain_conf.ml.html

Source file reason_toolchain_conf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
open Ppxlib

module From_current = struct
  include Selected_ast.Of_ocaml
  include Reason_omp.Convert (Reason_omp.OCaml_current) (Reason_omp.OCaml_414)
end

module To_current = struct
  include Selected_ast.To_ocaml
  include Reason_omp.Convert (Reason_omp.OCaml_414) (Reason_omp.OCaml_current)
end

module type Toolchain = sig
  (* Parsing *)
  val core_type_with_comments :
     Lexing.lexbuf
    -> Parsetree.core_type * Reason_comment.t list

  val implementation_with_comments :
     Lexing.lexbuf
    -> Parsetree.structure * Reason_comment.t list

  val interface_with_comments :
     Lexing.lexbuf
    -> Parsetree.signature * Reason_comment.t list

  val core_type : Lexing.lexbuf -> Parsetree.core_type
  val implementation : Lexing.lexbuf -> Parsetree.structure
  val interface : Lexing.lexbuf -> Parsetree.signature
  val toplevel_phrase : Lexing.lexbuf -> Parsetree.toplevel_phrase
  val use_file : Lexing.lexbuf -> Parsetree.toplevel_phrase list

  (* Printing *)
  val print_interface_with_comments :
     Format.formatter
    -> Parsetree.signature * Reason_comment.t list
    -> unit

  val print_implementation_with_comments :
     Format.formatter
    -> Parsetree.structure * Reason_comment.t list
    -> unit
end

module type Toolchain_spec = sig
  val safeguard_parsing :
     Lexing.lexbuf
    -> (unit -> 'a * Reason_comment.t list)
    -> 'a * Reason_comment.t list

  type token
  type invalid_docstrings

  module Lexer : sig
    type t

    val init : ?insert_completion_ident:Lexing.position -> Lexing.lexbuf -> t
    val get_comments : t -> invalid_docstrings -> (string * Location.t) list
  end

  val core_type : Lexer.t -> Parsetree.core_type * invalid_docstrings
  val implementation : Lexer.t -> Parsetree.structure * invalid_docstrings
  val interface : Lexer.t -> Parsetree.signature * invalid_docstrings

  val toplevel_phrase :
     Lexer.t
    -> Parsetree.toplevel_phrase * invalid_docstrings

  val use_file : Lexer.t -> Parsetree.toplevel_phrase list * invalid_docstrings

  val format_interface_with_comments :
     Parsetree.signature * Reason_comment.t list
    -> Format.formatter
    -> unit

  val format_implementation_with_comments :
     Parsetree.structure * Reason_comment.t list
    -> Format.formatter
    -> unit
end

let insert_completion_ident : Lexing.position option ref = ref None