-
Notifications
You must be signed in to change notification settings - Fork 482
Expand file tree
/
Copy pathres_parser.mli
More file actions
49 lines (41 loc) · 1.42 KB
/
res_parser.mli
File metadata and controls
49 lines (41 loc) · 1.42 KB
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
module Scanner = Res_scanner
module Token = Res_token
module Grammar = Res_grammar
module Reporting = Res_reporting
module Diagnostics = Res_diagnostics
module Comment = Res_comment
type mode = ParseForTypeChecker | Default
type region_status = Report | Silent
type t = {
mode: mode;
mutable scanner: Scanner.t;
mutable token: Token.t;
mutable start_pos: Lexing.position;
mutable end_pos: Lexing.position;
mutable prev_end_pos: Lexing.position;
mutable breadcrumbs: (Grammar.t * Lexing.position) list;
mutable errors: Reporting.parse_error list;
mutable diagnostics: Diagnostics.t list;
mutable comments: Comment.t list;
mutable regions: region_status ref list;
mutable uncurried_config: Config.uncurried;
}
val make : ?mode:mode -> string -> string -> t
val expect : ?grammar:Grammar.t -> Token.t -> t -> unit
val optional : t -> Token.t -> bool
val next : ?prev_end_pos:Lexing.position -> t -> unit
val next_unsafe : t -> unit (* Does not assert on Eof, makes no progress *)
val next_template_literal_token : t -> unit
val next_regex_token : t -> unit
val lookahead : t -> (t -> 'a) -> 'a
val err :
?start_pos:Lexing.position ->
?end_pos:Lexing.position ->
t ->
Diagnostics.category ->
unit
val leave_breadcrumb : t -> Grammar.t -> unit
val eat_breadcrumb : t -> unit
val begin_region : t -> unit
val end_region : t -> unit
val check_progress : prev_end_pos:Lexing.position -> result:'a -> t -> 'a option