Module Melange_compiler_libs.Lexer

The lexical analyzer

Warning: this module is unstable and part of compiler-libs.

let init: unit => unit;
let token: Stdlib.Lexing.lexbuf => Parser.token;
let skip_hash_bang: Stdlib.Lexing.lexbuf => unit;
type error =
  1. | Illegal_character(char)
  2. | Illegal_escape(string, option(string))
  3. | Reserved_sequence(string, option(string))
  4. | Unterminated_comment(Location.t)
  5. | Unterminated_string
  6. | Unterminated_string_in_comment(Location.t, Location.t)
  7. | Empty_character_literal
  8. | Keyword_as_label(string)
  9. | Invalid_literal(string)
  10. | Invalid_directive(string, option(string))
;
exception Error(error, Location.t);
let in_comment: unit => bool;
let in_string: unit => bool;
let print_warnings: Stdlib.ref(bool);
let handle_docstrings: Stdlib.ref(bool);
let comments: unit => list((string, Location.t));
let token_with_comments: Stdlib.Lexing.lexbuf => Parser.token;
let set_preprocessor: (unit => unit) => ((Stdlib.Lexing.lexbuf => Parser.token) => Stdlib.Lexing.lexbuf => Parser.token) => unit;