Skip to content

Commit

Permalink
Fix name and description extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Linda-Njau committed Aug 15, 2024
1 parent 454f4c8 commit cf38332
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/sail_json_backend/json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@ let parse_type_union i ucl =
match ucl with
| Tu_aux (Tu_ty_id (c, d), annot) ->
debug_print ~printer:prerr_string ("Tu_ty_id " ^ string_of_id d ^ "(");
List.iter
(fun attr ->
match attr with _, "name", Some (AD_aux (AD_string s, _)) -> Hashtbl.add names (string_of_id d) s | _ -> ()
)
annot.attrs;
begin
match annot.doc_comment with None -> () | Some s -> Hashtbl.add descriptions (string_of_id d) s
end;
begin
match c with
| Typ_aux (Typ_tuple x, _) ->
Expand All @@ -375,17 +383,7 @@ let parse_type_union i ucl =
)
x;
let l = List.map string_of_typ x in
Hashtbl.add sigs (string_of_id d) l;
List.iter
(fun attr ->
match attr with
| _, "name", Some (AD_aux (AD_string s, _)) -> Hashtbl.add names (string_of_id d) s
| _ -> ()
)
annot.attrs;
begin
match annot.doc_comment with None -> () | Some s -> Hashtbl.add descriptions (string_of_id d) s
end
Hashtbl.add sigs (string_of_id d) l
| Typ_aux (Typ_id i, _) -> Hashtbl.add sigs (string_of_id d) [string_of_id i]
| Typ_aux (Typ_app (i, _), _) ->
debug_print (string_of_typ c);
Expand Down

0 comments on commit cf38332

Please sign in to comment.