summaryrefslogtreecommitdiff
path: root/src/marker.ml
blob: 0c5980429a2c0aa72040cb4758a6ff1547c390c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
type t = Point
       | Pixel
       | Circle
       | TriangleDown
       | TriangleUp
       | TriangleLeft
       | TriangleRight
       | Custom of string

exception Invalid_marker_length
let of_string s = 
    if String.length s <> 1
    then raise Invalid_marker_length
    else Custom(s)

let pp channel n =
    (match n with
        | Point         -> "."
        | Pixel         -> ","
        | Circle        -> "o"
        | TriangleDown  -> "v"
        | TriangleUp    -> "^"
        | TriangleLeft  -> ">"
        | TriangleRight -> "<"
        | Custom(s)     -> s) 
    |> Printf.fprintf channel "%s"