Skip to content

Commit dad68a1

Browse files
committed
Remove unused OCaml variant in RescriptCompilerApi.Lang.t
1 parent cfaa584 commit dad68a1

File tree

4 files changed

+1
-10
lines changed

4 files changed

+1
-10
lines changed

src/Playground.res

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,7 @@ let make = (~versions: array<string>) => {
14381438
let initialContent = switch (Dict.get(router.query, "code"), initialLang) {
14391439
| (Some(compressedCode), _) => LzString.decompressToEncodedURIComponent(compressedCode)
14401440
| (None, Reason) => initialReContent
1441-
| (None, Res)
1442-
| (None, _) =>
1441+
| (None, Res) =>
14431442
switch initialVersion {
14441443
| Some({major: 10, minor}) if minor >= 1 => InitialContent.since_10_1
14451444
| Some({major}) if major > 10 => InitialContent.since_11

src/bindings/RescriptCompilerApi.res

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,23 @@
33
module Lang = {
44
type t =
55
| Reason
6-
| OCaml
76
| Res
87

98
let toString = t =>
109
switch t {
1110
| Res => "ReScript"
1211
| Reason => "Reason"
13-
| OCaml => "OCaml"
1412
}
1513

1614
let toExt = t =>
1715
switch t {
1816
| Res => "res"
1917
| Reason => "re"
20-
| OCaml => "ml"
2118
}
2219

2320
let decode = (json): t => {
2421
open! Json.Decode
2522
switch string(json) {
26-
| "ml" => OCaml
2723
| "re" => Reason
2824
| "res" => Res
2925
| other => raise(DecodeError(`Unknown language "${other}"`))

src/bindings/RescriptCompilerApi.resi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
module Lang: {
1010
type t =
1111
| Reason
12-
| OCaml
1312
| Res
1413

1514
let toString: t => string

src/common/CompilerManagerHook.res

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ let useCompilerManager = (
320320
let convResult = switch ready.targetLang {
321321
| Res => instance->Compiler.resFormat(code)->Some
322322
| Reason => instance->Compiler.reasonFormat(code)->Some
323-
| _ => None
324323
}
325324

326325
let result = switch convResult {
@@ -511,13 +510,11 @@ let useCompilerManager = (
511510
let compResult = switch apiVersion {
512511
| V1 =>
513512
switch lang {
514-
| Lang.OCaml => instance->Compiler.ocamlCompile(code)
515513
| Lang.Reason => instance->Compiler.reasonCompile(code)
516514
| Lang.Res => instance->Compiler.resCompile(code)
517515
}
518516
| V2 | V3 | V4 =>
519517
switch lang {
520-
| Lang.OCaml => instance->Compiler.ocamlCompile(code)
521518
| Lang.Reason =>
522519
CompilationResult.UnexpectedError(
523520
`Reason not supported with API version "${apiVersion->RescriptCompilerApi.Version.toString}"`,

0 commit comments

Comments
 (0)