Skip to content

Commit afa9388

Browse files
authored
Update reanalyze to 2.9.0, with support for exit as throwing an exception. (rescript-lang#79)
1 parent 559ca8c commit afa9388

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

syntax/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

syntax/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"devDependencies": {
1111
"bs-platform": "^7.3.2",
1212
"jest": "^24.9.0",
13-
"reanalyze": "^2.6.0"
13+
"reanalyze": "^2.9.0"
1414
},
1515
"scripts": {
1616
"test": "make test",

syntax/src/napkin_core.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5686,7 +5686,7 @@ and parseWithConstraint p =
56865686
end
56875687
| token ->
56885688
Parser.err p (Diagnostics.unexpected token p.breadcrumbs);
5689-
exit (-1) (* TODO: handle this case *)
5689+
exit (-1) [@doesNotRaise] (* TODO: handle this case *)
56905690

56915691
and parseModuleTypeOf p =
56925692
let startPos = p.Parser.startPos in

syntax/src/napkin_driver.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ let parse_implementation sourcefile =
9999
exit 1
100100
end;
101101
parseResult.parsetree
102+
[@@raises exit]
102103

103104
let parse_interface sourcefile =
104105
Location.input_name := sourcefile;
@@ -110,3 +111,4 @@ let parse_interface sourcefile =
110111
exit 1
111112
end;
112113
parseResult.parsetree
114+
[@@raises exit]

syntax/src/napkin_main.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ module CliArgProcessor = struct
105105
prerr_newline();
106106
exit 1
107107
| _ -> exit 1
108+
[@@raises exit]
108109
end
109110

111+
110112
let () =
111113
if not !Sys.interactive then begin
112114
NapkinClflags.parse ();

syntax/src/napkin_multi_printer.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ let printRes ~isInterface ~filename =
3636
~width:defaultPrintWidth
3737
~comments:parseResult.comments
3838
parseResult.parsetree
39+
[@@raises exit]
3940

4041
(* print ocaml files to res syntax *)
4142
let printMl ~isInterface ~filename =
@@ -128,4 +129,4 @@ let print language ~input =
128129
| `res -> printRes ~isInterface ~filename:input
129130
| `ml -> printMl ~isInterface ~filename:input
130131
| `refmt path -> printReason ~refmtPath:path ~isInterface ~filename:input
131-
[@@raises Sys_error]
132+
[@@raises (Sys_error, exit)]

0 commit comments

Comments
 (0)