Module Spectrum.Parser

Parser for converting lexer output into structured tokens.

exception InvalidStyleName of string
exception InvalidColorName of string
module Style : sig ... end
type rgba = {
  1. r : int;
  2. g : int;
  3. b : int;
  4. a : float;
}
val rgba_of_color : Gg.color -> rgba
module Rgb : sig ... end
type color_def =
  1. | NamedBasicColor of Basic.t
  2. | Named256Color of Xterm256.t
  3. | RgbColor of Gg.v4
val rgbcolor : Gg.v4 -> color_def
type token =
  1. | Foreground of color_def
  2. | Background of color_def
  3. | Control of Style.t
exception InvalidTag of string
exception InvalidHexColor of string
exception InvalidRgbColor of string
exception InvalidPercentage of string
exception InvalidQualifier of string
exception Eof
val from_name : string -> color_def
val from_hex : string -> color_def
val parse_int_256 : string -> int
val from_rgb : string -> string -> string -> color_def
val parse_float_percent : string -> float
val from_hsl : string -> string -> string -> color_def
val qualified : string option -> color_def -> token
val qualified_color_from_name : string option -> string -> token
val qualified_color_from_hex : string option -> string -> token
val qualified_color_from_rgb : string option -> string -> string -> string -> token
val qualified_color_from_hsl : string option -> string -> string -> string -> token
type compound_tag = {
  1. bold : bool;
  2. dim : bool;
  3. italic : bool;
  4. underline : bool;
  5. inverse : bool;
  6. hidden : bool;
  7. strikethru : bool;
  8. overline : bool;
  9. fg_color : color_def option;
  10. bg_color : color_def option;
}
val compound_of_tokens : token list -> compound_tag