-
- fields +> List.iter
- (fun (field) ->
-
- match field with
- | DeclarationField(FieldDeclList(onefield_multivars,iiptvirg))->
- (match onefield_multivars with
- | x::xs ->
- (* handling the first var. Special case, with the
- first var, we print the whole type *)
-
- (match x with
- | (Simple (nameopt, typ)), iivirg ->
- (* first var cant have a preceding ',' *)
- assert (List.length iivirg =|= 0);
- let identinfo =
- match nameopt with
- | None -> None
- | Some name -> Some (get_s_and_info_of_name name)
- in
- pp_type_with_ident identinfo None typ Ast_c.noattr;
-
- | (BitField (nameopt, typ, iidot, expr)), iivirg ->
- (* first var cant have a preceding ',' *)
- assert (List.length iivirg =|= 0);
- (match nameopt with
- | None ->
- pp_type typ;
- | Some name ->
- let (s, is) = get_s_and_info_of_name name in
- pp_type_with_ident
- (Some (s, is)) None typ Ast_c.noattr;
- );
- pr_elem iidot;
- pp_expression expr
-
- ); (* match x, first onefield_multivars *)
-
- (* for other vars *)
- xs +> List.iter (function
- | (Simple (nameopt, typ)), iivirg ->
- iivirg +> List.iter pr_elem;
- let identinfo =
- match nameopt with
- | None -> None
- | Some name -> Some (get_s_and_info_of_name name)
- in
- pp_type_with_ident_rest identinfo typ Ast_c.noattr
-
- | (BitField (nameopt, typ, iidot, expr)), iivirg ->
- iivirg +> List.iter pr_elem;
- (match nameopt with
- | Some name ->
- let (s,is) = get_s_and_info_of_name name in
- pp_type_with_ident_rest
- (Some (s, is)) typ Ast_c.noattr;
- pr_elem iidot;
- pp_expression expr
- | x -> raise Impossible
- )); (* iter other vars *)
-
- | [] -> raise Impossible
- ); (* onefield_multivars *)
- assert (List.length iiptvirg =|= 1);
- iiptvirg +> List.iter pr_elem;
-
-
- | MacroDeclField ((s, es), ii) ->
- let (iis, lp, rp, iiend, ifakestart) =
- Common.tuple_of_list5 ii in
- (* iis::lp::rp::iiend::ifakestart::iisto
- iisto +> List.iter pr_elem; (* static and const *)
- *)
- pr_elem ifakestart;
- pr_elem iis;
- pr_elem lp;
- es +> List.iter (fun (e, opt) ->
- assert (List.length opt <= 1);
- opt +> List.iter pr_elem;
- pp_argument e;
- );
-
- pr_elem rp;
- pr_elem iiend;
-
-
-
- | EmptyField iipttvirg_when_emptyfield ->
- pr_elem iipttvirg_when_emptyfield
-
- | CppDirectiveStruct cpp -> pp_directive cpp
- | IfdefStruct ifdef -> pp_ifdef ifdef
- );
-