ocaml: +syntax/Reporter
This commit is contained in:
parent
42afefb5e9
commit
216e0d1efb
20
ocaml/libsyntax/reporter.ml
Normal file
20
ocaml/libsyntax/reporter.ml
Normal 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)
|
Loading…
Reference in a new issue