@@ -68,7 +68,7 @@ module Event = struct
6868 | Call of {callee : Common.Path .t ; modulePath : Common.Path .t } (* foo() *)
6969 | DoesNotThrow of
7070 t list (* DoesNotThrow(events) where events come from an expression *)
71- | Throws (* * raise E *)
71+ | Throws (* * throw E *)
7272
7373 and t = {exceptions : Exceptions .t ; kind : kind ; loc : Location .t }
7474
@@ -158,12 +158,12 @@ module Event = struct
158158 if Exceptions. isEmpty exceptions then loop exnSet rest
159159 else
160160 let nestedExceptions = loop Exceptions. empty nestedEvents in
161- let newRaises = Exceptions. diff nestedExceptions exceptions in
161+ let newThrows = Exceptions. diff nestedExceptions exceptions in
162162 exceptions
163163 |> Exceptions. iter (fun exn ->
164164 nestedEvents
165165 |> List. iter (fun event -> shrinkExnTable exn event.loc));
166- loop (Exceptions. union exnSet newRaises ) rest
166+ loop (Exceptions. union exnSet newThrows ) rest
167167 | [] -> exnSet
168168 in
169169 let exnSet = loop Exceptions. empty events in
@@ -202,17 +202,17 @@ module Checks = struct
202202 (Common. ExceptionAnalysis
203203 {
204204 message =
205- (let raisesDescription ppf () =
205+ (let throwsDescription ppf () =
206206 if throwSet |> Exceptions. isEmpty then
207- Format. fprintf ppf " raises nothing"
207+ Format. fprintf ppf " throws nothing"
208208 else
209- Format. fprintf ppf " might raise %a"
209+ Format. fprintf ppf " might throw %a"
210210 (Exceptions. pp ~exn Table:(Some exnTable))
211211 throwSet
212212 in
213213 Format. asprintf
214214 " @{<info>%s@} %a and is annotated with redundant @throws(%a)"
215- exnName raisesDescription ()
215+ exnName throwsDescription ()
216216 (Exceptions. pp ~exn Table:None )
217217 redundantAnnotations);
218218 })
@@ -250,7 +250,7 @@ let traverseAst () =
250250 case.c_rhs |> iterExpr self)
251251 in
252252 let isThrow s = s = " Pervasives.raise" || s = " Pervasives.throw" in
253- let raiseArgs args =
253+ let throwArgs args =
254254 match args with
255255 | [(_, Some {Typedtree. exp_desc = Texp_construct ({txt}, _, _)})] ->
256256 [Exn. fromLid txt] |> Exceptions. fromList
@@ -304,13 +304,13 @@ let traverseAst () =
304304 when (* raise @@ Exn(...) *)
305305 atat |> Path. name = " Pervasives.@@" && callee |> Path. name |> isThrow
306306 ->
307- let exceptions = [arg] |> raiseArgs in
307+ let exceptions = [arg] |> throwArgs in
308308 currentEvents := {Event. exceptions; loc; kind = Throws } :: ! currentEvents;
309309 arg |> snd |> iterExprOpt self
310310 | Texp_apply {funct = {exp_desc = Texp_ident (callee , _ , _ )} as e ; args} ->
311311 let calleeName = Path. name callee in
312312 if calleeName |> isThrow then
313- let exceptions = args |> raiseArgs in
313+ let exceptions = args |> throwArgs in
314314 currentEvents :=
315315 {Event. exceptions; loc; kind = Throws } :: ! currentEvents
316316 else e |> iterExpr self;
0 commit comments