File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -142,25 +142,25 @@ let process_cmt_file cmt =
142
142
let output_file_relative = cmt |> Paths. get_output_file_relative ~config in
143
143
let file_name = cmt |> Paths. get_module_name in
144
144
let is_interface = Filename. check_suffix cmt_file " .cmti" in
145
+ let input_cmt, has_gentype_annotations =
146
+ read_input_cmt is_interface cmt_file
147
+ in
148
+ let source_file =
149
+ match input_cmt.cmt_annots |> FindSourceFile. cmt with
150
+ | Some source_file -> source_file
151
+ | None -> (
152
+ (file_name |> ModuleName. to_string)
153
+ ^
154
+ match is_interface with
155
+ | true -> " .resi"
156
+ | false -> " .res" )
157
+ in
145
158
let resolver =
146
159
ModuleResolver. create_lazy_resolver ~config
147
160
~extensions: [" .res" ; " .shim.ts" ] ~exclude_file: (fun fname ->
148
161
fname = " React.res" || fname = " ReasonReact.res" )
149
162
in
150
- let input_cmt, has_gentype_annotations =
151
- read_input_cmt is_interface cmt_file
152
- in
153
163
if has_gentype_annotations then
154
- let source_file =
155
- match input_cmt.cmt_annots |> FindSourceFile. cmt with
156
- | Some source_file -> source_file
157
- | None -> (
158
- (file_name |> ModuleName. to_string)
159
- ^
160
- match is_interface with
161
- | true -> " .resi"
162
- | false -> " .res" )
163
- in
164
164
input_cmt
165
165
|> translate_c_m_t ~config ~output_file_relative ~resolver
166
166
|> emit_translation ~config ~file_name ~output_file ~output_file_relative
You can’t perform that action at this time.
0 commit comments