Release coccinelle-0.1.9-rc1
[bpt/coccinelle.git] / parsing_cocci / get_constants.ml
index 3cd8f90..814e9c1 100644 (file)
@@ -1,5 +1,5 @@
 (*
-* Copyright 2005-2008, Ecole des Mines de Nantes, University of Copenhagen
+* Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
 * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
 * This file is part of Coccinelle.
 * 
@@ -83,7 +83,7 @@ let get_minus_constants bind orbind =
        if !Flag.sgrep_mode2
        then
          match ty with
-           (_,_,Ast.MINUS(_,_),_) -> [Ast.unwrap_mcode ty]
+           (_,_,Ast.MINUS(_,_,_,_),_) -> [Ast.unwrap_mcode ty]
          | _ -> []
        else [Ast.unwrap_mcode ty]
     | _ -> k e in
@@ -118,7 +118,6 @@ let get_minus_constants bind orbind =
 
   V.combiner bind option_default
     mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
-    mcode
     donothing donothing donothing donothing
     ident expression fullType typeC donothing donothing declaration
     rule_elem statement donothing donothing donothing
@@ -131,13 +130,12 @@ let get_all_minus_constants =
   let option_default = [] in
   let mcode r (x,_,mcodekind,_) =
     match mcodekind with
-      Ast.MINUS(_,_) -> [x]
+      Ast.MINUS(_,_,_,_) -> [x]
     | _ -> [] in
   let other r (x,_,mcodekind,_) = [] in
 
   V.combiner bind option_default
     other mcode other other other other other other other other other other
-    other
 
     donothing donothing donothing donothing
     donothing donothing donothing donothing donothing donothing donothing
@@ -158,7 +156,7 @@ let get_plus_constants =
               bind (fn.V.combiner_anything cur) prev))
        [] l in
     match mcodekind with
-      Ast.MINUS(_,anythings) -> recurse anythings
+      Ast.MINUS(_,_,_,anythings) -> recurse anythings
     | Ast.CONTEXT(_,Ast.BEFORE(a)) -> recurse a
     | Ast.CONTEXT(_,Ast.AFTER(a)) -> recurse a
     | Ast.CONTEXT(_,Ast.BEFOREAFTER(a1,a2)) ->
@@ -167,7 +165,6 @@ let get_plus_constants =
 
   V.combiner bind option_default
     mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
-    mcode
     donothing donothing donothing donothing
     donothing donothing donothing donothing donothing donothing donothing
     donothing donothing donothing donothing donothing
@@ -255,7 +252,6 @@ let check_inherited nm =
 
   V.combiner bind option_default
     mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
-    mcode
     donothing donothing donothing donothing
     strictident strictexpr strictfullType stricttypeC donothing strictparam
     strictdecls strictrule_elem strictstatement donothing donothing donothing
@@ -305,8 +301,10 @@ let get_constants rules =
         (function (rest_info,in_plus) ->
           function r ->
             match r with
-              Ast.ScriptRule (_,mv,deps,_) -> (rest_info, in_plus)
-            | Ast.CocciRule (nm, (dep,_,_), cur, _) ->
+              Ast.ScriptRule (_,_,_,_)
+           | Ast.InitialScriptRule (_,_) | Ast.FinalScriptRule (_,_) ->
+               (rest_info, in_plus)
+            | Ast.CocciRule (nm, (dep,_,_), cur, _, _) ->
                 let (cur_info,cur_plus) = rule_fn cur in_plus in
                let cur_info =
                  (* no dependencies if dependent on another rule; then we