package graphql_ppx

  1. Overview
  2. Docs
type lexer = {
  1. source : string;
  2. length : int;
  3. mutable position : Source_pos.source_position;
  4. mutable has_reached_eof : bool;
}
type token =
  1. | Name of string
  2. | Int of int
  3. | Float of float
  4. | String of string
  5. | Exclamation_mark
  6. | Dollar
  7. | Paren_open
  8. | Paren_close
  9. | Bracket_open
  10. | Bracket_close
  11. | Curly_open
  12. | Curly_close
  13. | Ellipsis
  14. | Dot
  15. | Colon
  16. | Equals
  17. | At
  18. | Pipe
  19. | End_of_file
val string_of_token : token -> string
type lexerError =
  1. | Unknown_character of char
  2. | Unexpected_character of char
  3. | Unterminated_string
  4. | Unknown_character_in_string of char
  5. | Unknown_escape_sequence of string
  6. | Unexpected_end_of_file
  7. | Invalid_number
val make : string -> lexer
val peek_char : lexer -> (int * char) option
val peek_char_only : lexer -> char option
val next_char : lexer -> (int * char) option
exception Internal_lexer_error
val emit_single_char : lexer -> 'a -> 'a Source_pos.spanning
val scan_over_whitespace : lexer -> unit
val scan_to_end_of_line : lexer -> unit
val is_name_start : char -> bool
val is_digit : char -> bool
val is_name_cont : char -> bool
val is_number_start : char -> bool
val scan_name : lexer -> (token Source_pos.spanning, lexerError Source_pos.spanning) Result.result
val scan_ellipsis_or_dot : lexer -> (token Source_pos.spanning, lexerError Source_pos.spanning) Result.result
val scan_digits : lexer -> (int, lexerError Source_pos.spanning) Result.result
val scan_integer_part : lexer -> (int, lexerError Source_pos.spanning) Result.result
val scan_number : lexer -> (token Source_pos.spanning, lexerError Source_pos.spanning) Result.result
val scan_string : lexer -> (token Source_pos.spanning, lexerError Source_pos.spanning) Result.result
val scan_single_token : lexer -> (token Source_pos.spanning, lexerError Source_pos.spanning) Result.result option
val consume : lexer -> (token Source_pos.spanning list, lexerError Source_pos.spanning) Result.result
OCaml

Innovation. Community. Security.