Coccinelle release 0.2.5-rc5
[bpt/coccinelle.git] / parsing_cocci / single_statement.ml
index 9a5bc11..30bb058 100644 (file)
@@ -117,6 +117,7 @@ let rec left_ident i =
   | Ast0.MetaId(name,_,_) -> modif_before_mcode name
   | Ast0.MetaFunc(name,_,_) -> modif_before_mcode name
   | Ast0.MetaLocalFunc(name,_,_) -> modif_before_mcode name
+  | Ast0.DisjId(_,id_list,_,_) -> List.exists left_ident id_list
   | Ast0.OptIdent(id) -> left_ident id
   | Ast0.UniqueIdent(id) -> left_ident id
 
@@ -127,6 +128,7 @@ let rec right_ident i =
   | Ast0.MetaId(name,_,_) -> modif_after_mcode name
   | Ast0.MetaFunc(name,_,_) -> modif_after_mcode name
   | Ast0.MetaLocalFunc(name,_,_) -> modif_after_mcode name
+  | Ast0.DisjId(_,id_list,_,_) -> List.exists right_ident id_list
   | Ast0.OptIdent(id) -> right_ident id
   | Ast0.UniqueIdent(id) -> right_ident id
 
@@ -355,6 +357,13 @@ and contains_only_minus =
       Ast0.DOTS([]) | Ast0.CIRCLES([]) | Ast0.STARS([]) -> true
     | _ -> k e in
 
+  let identifier r k e =
+    mcodekind (Ast0.get_mcodekind e) &&
+    match Ast0.unwrap e with
+      Ast0.DisjId(starter,id_list,mids,ender) ->
+       List.for_all r.VT0.combiner_rec_ident id_list
+    | _ -> k e in
+
   let expression r k e =
     mcodekind (Ast0.get_mcodekind e) &&
     match Ast0.unwrap e with
@@ -393,7 +402,7 @@ and contains_only_minus =
   V0.flat_combiner bind option_default
     mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode mcode
     dots dots dots dots dots dots
-    donothing expression typeC donothing donothing declaration
+    identifier expression typeC donothing donothing declaration
     statement case_line donothing