about summary refs log tree commit diff
path: root/lib/Reporter.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Reporter.ml')
-rw-r--r--lib/Reporter.ml18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Reporter.ml b/lib/Reporter.ml
index c86a04a..a90966c 100644
--- a/lib/Reporter.ml
+++ b/lib/Reporter.ml
@@ -1,10 +1,11 @@
 module Message =
 struct
-  type t = 
+  type t =
     | SyntaxError
     | IllTyped
     | UnboundVariable
     | CannotInferType
+    | Bug
 
   let default_severity : t -> Asai.Diagnostic.severity =
     function
@@ -12,17 +13,20 @@ struct
     | IllTyped -> Error
     | UnboundVariable -> Error
     | CannotInferType -> Error
+    | Bug -> Bug
 
   let short_code : t -> string =
     function
-    | SyntaxError -> "E0001"
-    | IllTyped -> "E0002"
-    | UnboundVariable -> "E0003"
-    | CannotInferType -> "E0004"
+    | SyntaxError -> "E001"
+    | IllTyped -> "E002"
+    | UnboundVariable -> "E003"
+    | CannotInferType -> "E004"
+    | Bug -> "BUG"
 end
 
 include Asai.Reporter.Make(Message)
 
-let invalid_local_name (name : Ast.raw_ident) = fatalf SyntaxError "invalid local variable name `%a`" Ast.dump_raw_ident name
+let unbound_variable id = fatalf UnboundVariable "unbound variable %a" Ident.pp id
+let expected_universe fmt x = fatalf IllTyped "expected a universe but got %a" fmt x
 
-let expected_universe fmt x = fatalf IllTyped "expected a universe but got %a" fmt x
\ No newline at end of file
+let bug msg = fatalf Bug msg