package lib_parsing

  1. Overview
  2. Docs
type token_location = {
  1. str : string;
  2. charpos : int;
  3. line : int;
  4. column : int;
  5. file : Common.filename;
}
val show_token_location : token_location -> Ppx_deriving_runtime.string
type token_origin =
  1. | OriginTok of token_location
  2. | FakeTokStr of string * (token_location * int) option
  3. | ExpandedTok of token_location * token_location * int
  4. | Ab
type token_mutable = {
  1. token : token_origin;
  2. mutable transfo : transformation;
}
and transformation =
  1. | NoTransfo
  2. | Remove
  3. | AddBefore of add
  4. | AddAfter of add
  5. | Replace of add
  6. | AddArgsBefore of string list
and add =
  1. | AddStr of string
  2. | AddNewlineAndIdent
type t = token_mutable
val equal : t -> t -> Ppx_deriving_runtime.bool
val pp_full_token_info : bool ref
val pp : Format.formatter -> t -> unit
type token_kind =
  1. | LPar
  2. | RPar
  3. | LBrace
  4. | RBrace
  5. | LBracket
  6. | RBracket
  7. | LAngle
  8. | RAngle
  9. | Esthet of esthet
  10. | Eof
  11. | Other
and esthet =
  1. | Comment
  2. | Newline
  3. | Space
exception Lexical_error of string * t
exception Parsing_error of t
exception Ast_builder_error of string * t
exception Other_error of string * t
val lexical_error : string -> Lexing.lexbuf -> unit
val register_exception_printer : unit -> unit
val tokinfo : Lexing.lexbuf -> t
val mk_info_of_loc : token_location -> t
val first_loc_of_file : Common.filename -> token_location
val tokinfo_str_pos : string -> int -> t
val rewrap_str : string -> t -> t
val tok_add_s : string -> t -> t
val combine_infos : t -> t list -> t
val split_info_at_pos : int -> t -> t * t
exception NoTokenLocation of string
val fake_token_location : token_location
val is_fake : t -> bool
val is_origintok : t -> bool
val has_origin_loc : t -> bool

Either an OriginTok or a FakeTokStr associated with a real location.

val unsafe_fake_info : string -> t
val unsafe_fake_bracket : 'a -> t * 'a * t
val unsafe_sc : t
val fake_info_loc : token_location -> string -> t
val fake_info : t -> string -> t
val fake_bracket_loc : token_location -> 'a -> t * 'a * t
val fake_bracket : t -> 'a -> t * 'a * t
val sc_loc : token_location -> t
val sc : t -> t
val unbracket : (t * 'a * t) -> 'a
val str_of_info : t -> string
val line_of_info : t -> int
val col_of_info : t -> int
val pos_of_info : t -> int
val file_of_info : t -> Common.filename
val string_of_info : t -> string
val token_location_of_info : t -> (token_location, string) result
val unsafe_token_location_of_info : t -> token_location
val get_original_token_location : token_origin -> token_location
val compare_pos : t -> t -> int
val min_max_ii_by_pos : t list -> t * t
val abstract_info : t
OCaml

Innovation. Community. Security.