24 lines
722 B
OCaml
24 lines
722 B
OCaml
open Types
|
|
|
|
let print_colour = function
|
|
| Simple n | Intrinsic n ->
|
|
print_endline ("simple/intrinsic " ^ string_of_int n)
|
|
| RGB (r, g, b) ->
|
|
print_endline
|
|
("rgb: "
|
|
^ List.fold_left
|
|
(fun acc el -> acc ^ ", " ^ string_of_int el)
|
|
"" [ r; g; b ])
|
|
|
|
let print_ansi =
|
|
List.fold_left (fun _acc el ->
|
|
match el with
|
|
| Fg c -> print_string "fg "; print_colour c
|
|
| Bg c -> print_string "bg "; print_colour c
|
|
| Reset -> print_endline "ansi reset"
|
|
| Other n -> print_endline ("other ansi: " ^ string_of_int n))
|
|
|
|
let debug_print = function
|
|
| Text s | Separator s | Delimiter s -> print_endline ("parsed '" ^ s ^ "'")
|
|
| Ansi a -> print_ansi () a
|