package rocq-runtime

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The type of token for the Rocq lexer and parser

type 'c p =
  1. | PKEYWORD : string -> string p
  2. | PIDENT : string option -> string p
  3. | PFIELD : string option -> string p
  4. | PNUMBER : NumTok.Unsigned.t option -> NumTok.Unsigned.t p
  5. | PSTRING : string option -> string p
  6. | PLEFTQMARK : unit p
  7. | PBULLET : string option -> string p
  8. | PQUOTATION : string -> string p
  9. | PEOI : unit p
val pattern_strings : 'c p -> string * string option
type t =
  1. | KEYWORD of string
  2. | IDENT of string
  3. | FIELD of string
  4. | NUMBER of NumTok.Unsigned.t
  5. | STRING of string
  6. | LEFTQMARK
  7. | BULLET of string
  8. | QUOTATION of string * string
  9. | EOI
val equal_p : 'a p -> 'b p -> ('a, 'b) Util.eq option
val equal : t -> t -> bool
val extract_string : bool -> t -> string

Names of tokens, used in Grammar error messages

val token_text : 'c p -> string
val trim_quotation : string -> char option * string

Utility function for the test returned by a QUOTATION token: It returns the delimiter parenthesis, if any, and the text without delimiters. Eg `{{ text

}

}

` -> Some '{', ` text `

val match_pattern : 'c p -> t -> 'c

for camlp5, eg GRAMMAR EXTEND ..... [ IDENT "x" -> .... ] END is a pattern (PIDENT (Some "x"))

OCaml

Innovation. Community. Security.