Skip to content

Commit

Permalink
Take compiler api V4 into account
Browse files Browse the repository at this point in the history
  • Loading branch information
fhammerschmidt committed Oct 31, 2023
1 parent ad85d25 commit 412f86c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/bindings/RescriptCompilerApi.res
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module Version = {
| V1
| V2
| V3
| V4
| UnknownVersion(string)

// Helps finding the right API version
Expand All @@ -57,6 +58,7 @@ module Version = {
}
| list{"2"} => V2
| list{"3"} => V3
| list{"4"} => V4
| _ => UnknownVersion(apiVersion)
}

Expand All @@ -65,6 +67,7 @@ module Version = {
| V1 => "1.0"
| V2 => "2.0"
| V3 => "3.0"
| V4 => "4.0"
| UnknownVersion(version) => version
}

Expand All @@ -73,7 +76,7 @@ module Version = {
let availableLanguages = t =>
switch t {
| V1 => [Lang.Reason, Res]
| V2 | V3 => [Lang.Res]
| V2 | V3 | V4 => [Lang.Res]
| UnknownVersion(_) => [Res]
}
}
Expand Down
1 change: 1 addition & 0 deletions src/bindings/RescriptCompilerApi.resi
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module Version: {
| V1
| V2
| V3
| V4
| UnknownVersion(string)

// Helps finding the right API version
Expand Down
2 changes: 1 addition & 1 deletion src/common/CompilerManagerHook.res
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ let useCompilerManager = (
| Lang.Reason => instance->Compiler.reasonCompile(code)
| Lang.Res => instance->Compiler.resCompile(code)
}
| V2 | V3 =>
| V2 | V3 | V4 =>
switch lang {
| Lang.OCaml => instance->Compiler.ocamlCompile(code)
| Lang.Reason =>
Expand Down

0 comments on commit 412f86c

Please sign in to comment.