-
Notifications
You must be signed in to change notification settings - Fork 482
Expand file tree
/
Copy pathres_scanner.mli
More file actions
38 lines (29 loc) · 1 KB
/
res_scanner.mli
File metadata and controls
38 lines (29 loc) · 1 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
type mode = Jsx | Diamond
type char_encoding
type t = {
filename: string;
src: string;
mutable err:
start_pos:Lexing.position ->
end_pos:Lexing.position ->
Res_diagnostics.category ->
unit;
mutable ch: char_encoding; (* current character *)
mutable offset: int; (* current byte offset *)
mutable offset16: int;
(* current number of utf16 code units since line start *)
mutable line_offset: int; (* current line offset *)
mutable lnum: int; (* current line number *)
mutable mode: mode list;
}
val make : filename:string -> string -> t
(* TODO: make this a record *)
val scan : t -> Lexing.position * Lexing.position * Res_token.t
val is_binary_op : string -> int -> int -> bool
val set_jsx_mode : t -> unit
val set_diamond_mode : t -> unit
val pop_mode : t -> mode -> unit
val reconsider_less_than : t -> Res_token.t
val scan_template_literal_token :
t -> Lexing.position * Lexing.position * Res_token.t
val scan_regex : t -> Lexing.position * Lexing.position * Res_token.t