ocaml: +syntax/Reporter

This commit is contained in:
Alain Emilia Anna Zscheile 2024-02-26 00:11:26 +01:00
parent 42afefb5e9
commit 216e0d1efb

View file

@ -0,0 +1,20 @@
module Message = struct
type t = Error of Tys.error_kind
let default_severity = function
| Error _ -> Asai.Diagnostic.Error
let short_code = let open Tys in function
(* immediate syntax stuff *)
| Error (EUnhandled _ ) -> "YNS-U0001"
| Error (EUnexpectedEof _ ) -> "YNS-U0002"
| Error (EUnexpectedToken _ ) -> "YNS-U0003"
(* non-immediate stuff *)
| Error (ESys _ ) -> "YNS-E0001"
| Error (EExpected _ ) -> "YNS-E0002"
| Error (EUnknownIdent _ ) -> "YNS-E0003"
| Error (ERecordDupIdent _ ) -> "YNS-E0004"
| Error (EPatternDupIdent _ ) -> "YNS-E0005"
end
include Asai.Reporter.Make(Message)