X-Git-Url: http://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/8ba84ae2b4ba7d58a4c0f6d90ca093c9202ca5ab..b1b2de814d2c59af2526bc19d41bb22a0c1fd16d:/parsing_cocci/comm_assoc.ml diff --git a/parsing_cocci/comm_assoc.ml b/parsing_cocci/comm_assoc.ml index 124b8d8..60857d0 100644 --- a/parsing_cocci/comm_assoc.ml +++ b/parsing_cocci/comm_assoc.ml @@ -28,6 +28,7 @@ Nested is not used before this phase. *) module Ast = Ast_cocci module Ast0 = Ast0_cocci module V0 = Visitor_ast0 +module VT0 = Visitor_ast0_types let comm_assoc = [Ast.Arith(Ast.Plus);Ast.Arith(Ast.Mul);Ast.Arith(Ast.And);Ast.Arith(Ast.Or); @@ -46,8 +47,6 @@ let nopos mc = match Ast0.get_pos mc with Ast0.MetaPos _ -> false | Ast0.NoMetaPos -> true let process_binops rule_name = - let donothing r k e = k e in - let mcode x = x in let expr r k e1 = let e = k e1 in match Ast0.unwrap e with @@ -73,13 +72,9 @@ let process_binops rule_name = e) | _ -> e) | _ -> e in - V0.rebuilder - mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode - donothing donothing donothing donothing donothing donothing - donothing expr donothing donothing donothing donothing donothing - donothing donothing + V0.rebuilder {V0.rebuilder_functions with VT0.rebuilder_exprfn = expr} let comm_assoc rule rule_name dropped_isos = if List.mem "comm_assoc" dropped_isos then rule - else List.map (process_binops rule_name).V0.rebuilder_top_level rule + else List.map (process_binops rule_name).VT0.rebuilder_rec_top_level rule