Skip to content

Commit 412f86c

Browse files
Take compiler api V4 into account
1 parent ad85d25 commit 412f86c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/bindings/RescriptCompilerApi.res

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module Version = {
3636
| V1
3737
| V2
3838
| V3
39+
| V4
3940
| UnknownVersion(string)
4041

4142
// Helps finding the right API version
@@ -57,6 +58,7 @@ module Version = {
5758
}
5859
| list{"2"} => V2
5960
| list{"3"} => V3
61+
| list{"4"} => V4
6062
| _ => UnknownVersion(apiVersion)
6163
}
6264

@@ -65,6 +67,7 @@ module Version = {
6567
| V1 => "1.0"
6668
| V2 => "2.0"
6769
| V3 => "3.0"
70+
| V4 => "4.0"
6871
| UnknownVersion(version) => version
6972
}
7073

@@ -73,7 +76,7 @@ module Version = {
7376
let availableLanguages = t =>
7477
switch t {
7578
| V1 => [Lang.Reason, Res]
76-
| V2 | V3 => [Lang.Res]
79+
| V2 | V3 | V4 => [Lang.Res]
7780
| UnknownVersion(_) => [Res]
7881
}
7982
}

src/bindings/RescriptCompilerApi.resi

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module Version: {
2424
| V1
2525
| V2
2626
| V3
27+
| V4
2728
| UnknownVersion(string)
2829

2930
// Helps finding the right API version

src/common/CompilerManagerHook.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ let useCompilerManager = (
488488
| Lang.Reason => instance->Compiler.reasonCompile(code)
489489
| Lang.Res => instance->Compiler.resCompile(code)
490490
}
491-
| V2 | V3 =>
491+
| V2 | V3 | V4 =>
492492
switch lang {
493493
| Lang.OCaml => instance->Compiler.ocamlCompile(code)
494494
| Lang.Reason =>

0 commit comments

Comments
 (0)