Module Js_parser.Flow_sedlexing

exception InvalidCodepoint(int);

This is a module provides the minimal Sedlexing suppport It is mostly a subset of Sedlexing with two functions for performance reasons:

  • Utf8.lexeme_to_buffer
  • Utf8.lexeme_to_buffer2
exception MalFormed;
type apos = int;
type lexbuf;
let lexbuf_clone: lexbuf => lexbuf;
let from_int_array: array(int) => lexbuf;
let new_line: lexbuf => unit;
let next: lexbuf => option(Uchar.t);
let mark: lexbuf => int => unit;
let start: lexbuf => unit;
let backtrack: lexbuf => int;
let rollback: lexbuf => unit;
let lexeme_start: lexbuf => int;
let lexeme_end: lexbuf => int;
let loc: lexbuf => (int, int);
let lexeme_length: lexbuf => int;
let sub_lexeme: lexbuf => int => int => array(int);
let lexeme: lexbuf => array(int);
module Utf8: { ... };
let string_of_utf8: array(int) => string;
let current_code_point: lexbuf => int;

Two APIs used when we want to do customize lexing instead of using the regex based engine

let backoff: lexbuf => int => unit;
let set_lexeme_start: lexbuf => int => unit;