Source file related_location.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
type t =
{ message : string option
; location : Location.t
}
let to_json { message; location } : Yojson.Basic.t =
`Assoc
(List.concat
[ (match message with
| None -> []
| Some m -> [ "message", `String m ])
; [ "location", Location.to_json location ]
])
;;