1Lexer(3) OCaml library Lexer(3)
2
3
4
6 Lexer - The lexical analyzer
7
9 Module Lexer
10
12 Module Lexer
13 : sig end
14
15
16 The lexical analyzer
17
18 Warning: this module is unstable and part of Compiler_libs .
19
20
21
22
23
24
25 val init : unit -> unit
26
27
28
29
30 val token : Lexing.lexbuf -> Parser.token
31
32
33
34
35 val skip_hash_bang : Lexing.lexbuf -> unit
36
37
38
39 type error =
40 | Illegal_character of char
41 | Illegal_escape of string * string option
42 | Reserved_sequence of string * string option
43 | Unterminated_comment of Location.t
44 | Unterminated_string
45 | Unterminated_string_in_comment of Location.t * Location.t
46 | Keyword_as_label of string
47 | Invalid_literal of string
48 | Invalid_directive of string * string option
49
50
51
52
53
54 exception Error of error * Location.t
55
56
57
58
59
60 val in_comment : unit -> bool
61
62
63
64
65 val in_string : unit -> bool
66
67
68
69
70 val print_warnings : bool ref
71
72
73
74
75 val handle_docstrings : bool ref
76
77
78
79
80 val comments : unit -> (string * Location.t) list
81
82
83
84
85 val token_with_comments : Lexing.lexbuf -> Parser.token
86
87
88
89
90 val set_preprocessor : (unit -> unit) -> ((Lexing.lexbuf -> Parser.to‐
91 ken) -> Lexing.lexbuf -> Parser.token) -> unit
92
93
94
95
96
97
98OCamldoc 2021-01-26 Lexer(3)