let sig_name = (String.lowercase server.server_name) ^ "_impl" in
fprintf ff "type %s =@\n" sig_name;
fprintf ff "@[<v 8>{@,";
- fprintf ff "(* RPCs *)";
+ if List.length rpc_list > 0 then
+ fprintf ff "(* RPCs *)";
List.iter (fun (rpc, resp) ->
let sg = get_arg_types rpc.rpc_request.request_params in
let sg = sg @ [ resp.response_value.param_type ] in
fprintf ff "@,%s: %s;" rpc.rpc_request.request_handler (String.concat " -> " sg)
) rpc_list;
- fprintf ff "@,@,(* Notifications *)";
+ if List.length notif_list > 0 then
+ (if List.length rpc_list > 0
+ then fprintf ff "@,@,(* Notifications *)"
+ else fprintf ff "(* Notifications *)");
List.iter (fun n ->
let sg = get_arg_types n.rpc_request.request_params in
let sg = sg @ [ "unit" ] in