فهرست منبع

add an Error exception to ast.ml so we have something that can be raised from anywhere

Simon Krajewski 10 سال پیش
والد
کامیت
495f3c5cd1
2فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 2 0
      ast.ml
  2. 2 0
      main.ml

+ 2 - 0
ast.ml

@@ -437,6 +437,8 @@ type type_decl = type_def * pos
 
 type package = string list * type_decl list
 
+exception Error of string * pos
+
 let is_lower_ident i =
 	let rec loop p =
 		match String.unsafe_get i p with

+ 2 - 0
main.ml

@@ -1589,6 +1589,8 @@ try
 with
 	| Abort ->
 		()
+	| Ast.Error (m,p) ->
+		error ctx m p
 	| Typecore.Fatal_error (m,p) ->
 		error ctx m p
 	| Common.Abort (m,p) ->