Skip to content

Commit 9c81326

Browse files
committed
signFile is unused
1 parent 3f1b44a commit 9c81326

File tree

2 files changed

+33
-35
lines changed

2 files changed

+33
-35
lines changed

jscomp/gentype/GenType.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
let version = Version.version
2-
let signFile s = s
32

43
type cliCommand = Add of string | Clean | NoOp | Rm of string list
54

@@ -44,7 +43,7 @@ let cli () =
4443
in
4544
let config = Paths.readConfig ~namespace:(cmt |> Paths.findNameSpace) in
4645
if !Debug.basic then Log_.item "Add %s %s\n" cmt mlast;
47-
cmt |> GenTypeMain.processCmtFile ~signFile ~config;
46+
cmt |> GenTypeMain.processCmtFile ~config;
4847
exit 0
4948
| Clean ->
5049
let config = Paths.readConfig ~namespace:None in

jscomp/gentype/GenTypeMain.ml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module StringSet = Set.Make (String)
33
let cmtCheckAnnotations ~checkAnnotation inputCMT =
44
match inputCMT.Cmt_format.cmt_annots with
55
| Implementation structure ->
6-
structure |> Annotation.structureCheckAnnotation ~checkAnnotation
6+
structure |> Annotation.structureCheckAnnotation ~checkAnnotation
77
| Interface signature ->
8-
signature |> Annotation.signatureCheckAnnotation ~checkAnnotation
8+
signature |> Annotation.signatureCheckAnnotation ~checkAnnotation
99
| _ -> false
1010

1111
let cmtHasTypeErrors inputCMT =
@@ -25,61 +25,60 @@ let signatureItemIsDeclaration signatureItem =
2525

2626
let inputCmtTranslateTypeDeclarations ~config ~outputFileRelative ~resolver
2727
inputCMT : CodeItem.translation =
28-
let {Cmt_format.cmt_annots} = inputCMT in
28+
let { Cmt_format.cmt_annots } = inputCMT in
2929
let typeEnv = TypeEnv.root () in
3030
let translations =
3131
match cmt_annots with
3232
| Implementation structure ->
33-
{
34-
structure with
35-
str_items =
36-
structure.str_items |> List.filter structureItemIsDeclaration;
37-
}
38-
|> TranslateStructure.translateStructure ~config ~outputFileRelative
39-
~resolver ~typeEnv
33+
{
34+
structure with
35+
str_items =
36+
structure.str_items |> List.filter structureItemIsDeclaration;
37+
}
38+
|> TranslateStructure.translateStructure ~config ~outputFileRelative
39+
~resolver ~typeEnv
4040
| Interface signature ->
41-
{
42-
signature with
43-
sig_items =
44-
signature.sig_items |> List.filter signatureItemIsDeclaration;
45-
}
46-
|> TranslateSignature.translateSignature ~config ~outputFileRelative
47-
~resolver ~typeEnv
41+
{
42+
signature with
43+
sig_items =
44+
signature.sig_items |> List.filter signatureItemIsDeclaration;
45+
}
46+
|> TranslateSignature.translateSignature ~config ~outputFileRelative
47+
~resolver ~typeEnv
4848
| Packed _ | Partial_implementation _ | Partial_interface _ -> []
4949
in
5050
translations |> Translation.combine
5151
|> Translation.addTypeDeclarationsFromModuleEquations ~typeEnv
5252

5353
let translateCMT ~config ~outputFileRelative ~resolver inputCMT : Translation.t
5454
=
55-
let {Cmt_format.cmt_annots} = inputCMT in
55+
let { Cmt_format.cmt_annots } = inputCMT in
5656
let typeEnv = TypeEnv.root () in
5757
let translations =
5858
match cmt_annots with
5959
| Implementation structure ->
60-
structure
61-
|> TranslateStructure.translateStructure ~config ~outputFileRelative
62-
~resolver ~typeEnv
60+
structure
61+
|> TranslateStructure.translateStructure ~config ~outputFileRelative
62+
~resolver ~typeEnv
6363
| Interface signature ->
64-
signature
65-
|> TranslateSignature.translateSignature ~config ~outputFileRelative
66-
~resolver ~typeEnv
64+
signature
65+
|> TranslateSignature.translateSignature ~config ~outputFileRelative
66+
~resolver ~typeEnv
6767
| _ -> []
6868
in
6969
translations |> Translation.combine
7070
|> Translation.addTypeDeclarationsFromModuleEquations ~typeEnv
7171

7272
let emitTranslation ~config ~fileName ~outputFile ~outputFileRelative ~resolver
73-
~signFile ~sourceFile translation =
73+
~sourceFile translation =
7474
let codeText =
7575
translation
7676
|> EmitJs.emitTranslationAsString ~config ~fileName ~outputFileRelative
7777
~resolver ~inputCmtTranslateTypeDeclarations
7878
in
7979
let fileContents =
80-
signFile
81-
(EmitType.fileHeader ~sourceFile:(Filename.basename sourceFile)
82-
^ "\n" ^ codeText ^ "\n")
80+
EmitType.fileHeader ~sourceFile:(Filename.basename sourceFile)
81+
^ "\n" ^ codeText ^ "\n"
8382
in
8483
GeneratedFiles.writeFileIfRequired ~outputFile ~fileContents
8584

@@ -94,7 +93,7 @@ let readCmt cmtFile =
9493
Log_.item "And try to clean and rebuild.\n\n";
9594
assert false
9695

97-
let processCmtFile ~signFile ~config cmt =
96+
let processCmtFile ~config cmt =
9897
let cmtFile = cmt |> Paths.getCmtFile in
9998
if cmtFile <> "" then
10099
let outputFile = cmt |> Paths.getOutputFile ~config in
@@ -103,7 +102,7 @@ let processCmtFile ~signFile ~config cmt =
103102
let isInterface = Filename.check_suffix cmtFile ".cmti" in
104103
let resolver =
105104
ModuleResolver.createLazyResolver ~config
106-
~extensions:[".re"; ".res"; EmitType.shimExtension]
105+
~extensions:[ ".re"; ".res"; EmitType.shimExtension ]
107106
~excludeFile:(fun fname ->
108107
fname = "React.re" || fname = "ReasonReact.re")
109108
in
@@ -153,13 +152,13 @@ let processCmtFile ~signFile ~config cmt =
153152
match inputCMT.cmt_annots |> FindSourceFile.cmt with
154153
| Some sourceFile -> sourceFile
155154
| None -> (
156-
(fileName |> ModuleName.toString)
157-
^ match isInterface with true -> ".resi" | false -> ".res")
155+
(fileName |> ModuleName.toString)
156+
^ match isInterface with true -> ".resi" | false -> ".res")
158157
in
159158
inputCMT
160159
|> translateCMT ~config ~outputFileRelative ~resolver
161160
|> emitTranslation ~config ~fileName ~outputFile ~outputFileRelative
162-
~resolver ~signFile ~sourceFile
161+
~resolver ~sourceFile
163162
else if inputCMT |> cmtHasTypeErrors then
164163
outputFile |> GeneratedFiles.logFileAction TypeError
165164
else (

0 commit comments

Comments
 (0)