File tree 2 files changed +24
-4
lines changed
2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -89,13 +89,16 @@ let rec forTypeSignatureItem ~(env : SharedTypes.Env.t) ~(exported : Exported.t)
89
89
| Type_record (fields , _ ) ->
90
90
Record
91
91
(fields
92
- |> List. map (fun {Types. ld_id; ld_type} ->
92
+ |> List. map (fun {Types. ld_id; ld_type; ld_attributes } ->
93
93
let astamp = Ident. binding_time ld_id in
94
94
let name = Ident. name ld_id in
95
95
{
96
96
stamp = astamp;
97
97
fname = Location. mknoloc name;
98
98
typ = ld_type;
99
+ optional =
100
+ Res_parsetree_viewer. hasOptionalAttribute
101
+ ld_attributes;
99
102
})));
100
103
}
101
104
~name ~stamp: (Ident. binding_time ident) ~env type_attributes
@@ -212,10 +215,22 @@ let forTypeDeclaration ~env ~(exported : Exported.t)
212
215
(fields
213
216
|> List. map
214
217
(fun
215
- {Typedtree. ld_id; ld_name = fname ; ld_type = {ctyp_type} }
218
+ {
219
+ Typedtree. ld_id;
220
+ ld_name = fname ;
221
+ ld_type = {ctyp_type} ;
222
+ ld_attributes;
223
+ }
216
224
->
217
225
let fstamp = Ident. binding_time ld_id in
218
- {stamp = fstamp; fname; typ = ctyp_type})));
226
+ {
227
+ stamp = fstamp;
228
+ fname;
229
+ typ = ctyp_type;
230
+ optional =
231
+ Res_parsetree_viewer. hasOptionalAttribute
232
+ ld_attributes;
233
+ })));
219
234
}
220
235
~name ~stamp ~env typ_attributes
221
236
(Exported. add exported Exported. Type )
Original file line number Diff line number Diff line change @@ -24,7 +24,12 @@ module ModulePath = struct
24
24
loop modulePath [tipName]
25
25
end
26
26
27
- type field = {stamp : int ; fname : string Location .loc ; typ : Types .type_expr }
27
+ type field = {
28
+ stamp : int ;
29
+ fname : string Location .loc ;
30
+ typ : Types .type_expr ;
31
+ optional : bool ;
32
+ }
28
33
29
34
module Constructor = struct
30
35
type t = {
You can’t perform that action at this time.
0 commit comments