~ubuntu-branches/ubuntu/karmic/coccinelle/karmic

« back to all changes in this revision

Viewing changes to parsing_cocci/function_prototypes.ml

  • Committer: Bazaar Package Importer
  • Author(s): Євгеній Мещеряков
  • Date: 2009-05-11 15:32:24 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090511153224-1odv41d4dkr3y80v
Tags: 0.1.8.deb-2
Use common install Makefile target for both native and bytecode
build. This hopefully fixes FTBFS on bytecode archs 

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
(* --------------------------------------------------------------------- *)
39
39
(* collect all of the functions *)
40
40
 
41
 
let brace_to_semi (_,arity,info,mcodekind,pos) =
42
 
  (";",Ast0.NONE,info,mcodekind,pos)
 
41
let brace_to_semi (_,arity,info,mcodekind,pos,adj) =
 
42
  let info =
 
43
    (* drop column information, so that with -smpl_spacing the semicolon
 
44
       will come out right after the close parenthesis *)
 
45
    {info with Ast0.pos_info = {info.Ast0.pos_info with Ast0.column = -1}} in
 
46
  (";",Ast0.NONE,info,mcodekind,pos,adj)
43
47
 
44
48
let collect_function (stm : Ast0.statement) =
45
49
  match Ast0.unwrap stm with
123
127
and strip =
124
128
  let donothing r k e =
125
129
    {(Ast0.wrap (Ast0.unwrap (k e))) with Ast0.mcodekind = ref Ast0.PLUS} in
126
 
  let mcode (mc,_,_,_,_) =
127
 
    (mc,Ast0.NONE,Ast0.default_info(),Ast0.PLUS,ref Ast0.NoMetaPos) in
 
130
  let mcode (mc,_,_,_,_,_) =
 
131
    (mc,Ast0.NONE,Ast0.default_info(),Ast0.PLUS,ref Ast0.NoMetaPos,-1) in
128
132
 
129
133
  (* need a case for everything that has an unvisited component and can be in
130
134
     a function prototype *)
221
225
  match Ast0.unwrap param with
222
226
    Ast0.Param(ty,Some id) when all ->
223
227
      (match Ast0.unwrap id with
224
 
        Ast0.MetaId(((_,name),arity,info,mcodekind,pos),constraints,pure) ->
 
228
        Ast0.MetaId
 
229
          (((_,name),arity,info,mcodekind,pos,adj),constraints,pure) ->
225
230
          let nm = ("__no_name__",new_name name) in
226
231
          let new_id =
227
232
            Ast0.rewrap id
228
233
              (Ast0.MetaId
229
 
                 ((nm,arity,info,mcodekind,pos),constraints,Ast0.Pure)) in
 
234
                 ((nm,arity,info,mcodekind,pos,adj),constraints,Ast0.Pure)) in
230
235
          ([Ast.MetaIdDecl(Ast.NONE,nm)],
231
236
           Ast0.rewrap param (Ast0.Param(ty,Some new_id)))
232
237
      | _ -> ([],param))
318
323
                                    Ast0.get_mcode_mcodekind lp in
319
324
                                  let pdots =
320
325
                                    ("...",Ast0.NONE,info,mcodekind,
321
 
                                     ref Ast0.NoMetaPos) in
 
326
                                     ref Ast0.NoMetaPos,-1) in
322
327
                                  Ast0.DOTS
323
328
                                    ([Ast0.rewrap params
324
329
                                         (Ast0.Pdots(pdots))])),