Up
module
Raw_lexer
:
sig
#
type
error =
#
| Illegal_character
of
char
#
| Illegal_escape
of
string
#
| Unterminated_comment
of
Location
.
t
#
| Unterminated_string
#
| Unterminated_string_in_comment
of
Location
.
t
*
Location
.
t
#
| Keyword_as_label
of
string
#
| Literal_overflow
of
string
#
exception
Error
of
error
*
Location
.
t
#
val
report_error :
Std
.Format.formatter
->
error
->
unit
#
type
keywords
#
val
keywords : (string *
Raw_parser
.
token
) list
->
keywords
#
type
'a result =
#
| Return
of
'a
#
| Refill
of
unit
->
'a
result
#
| Fail
of
error
*
Location
.
t
#
type
preprocessor = (
Std
.Lexing.lexbuf
->
Raw_parser
.
token
)
->
Std
.Lexing.lexbuf
->
Raw_parser
.
token
#
type
state = {
#
keywords
:
keywords
;
#
buffer
:
Buffer
.
t
;
#
mutable
string_start_loc
:
Location
.
t
;
#
mutable
comment_start_loc
:
Location
.
t
list
;
#
mutable
preprocessor
:
preprocessor
option
;
}
#
val
make : ?preprocessor:
preprocessor
->
keywords
->
state
#
val
skip_sharp_bang :
state
->
Std
.Lexing.lexbuf
->
Raw_parser
.
token
result
#
val
token :
state
->
Std
.Lexing.lexbuf
->
Raw_parser
.
token
result
#
type
comment = string *
Location
.
t
#
val
token_without_comments :
state
->
Std
.Lexing.lexbuf
->
Raw_parser
.
token
result
end