Coccinelle release 0.2.5-rc8
[bpt/coccinelle.git] / parsing_cocci / iso_pattern.ml
index af3aae2..c3a118b 100644 (file)
@@ -416,7 +416,9 @@ let match_maker checks_needed context_required whencode_allowed =
     let decl r k d =
       bind (bind (pure_mcodekind (Ast0.get_mcodekind d)) (k d))
        (match Ast0.unwrap d with
-         Ast0.MetaDecl(name,pure) | Ast0.MetaField(name,pure) -> pure
+         Ast0.MetaDecl(name,pure) | Ast0.MetaField(name,pure)
+       | Ast0.MetaFieldList(name,_,pure) ->
+           pure
        | _ -> Ast0.Impure) in
 
     let stmt r k s =
@@ -500,6 +502,8 @@ let match_maker checks_needed context_required whencode_allowed =
              if mcode_equal namea nameb
              then check_mcode namea nameb
              else return false
+         | (Ast0.DisjId(_,ids,_,_),_) ->
+             failwith "not allowed in the pattern of an isomorphism"
          | (Ast0.OptIdent(ida),Ast0.OptIdent(idb))
          | (Ast0.UniqueIdent(ida),Ast0.UniqueIdent(idb)) ->
              match_ident ida idb
@@ -816,7 +820,7 @@ let match_maker checks_needed context_required whencode_allowed =
              if mcode_equal namea nameb
              then check_mcode namea nameb
              else return false
-         | (Ast0.DisjType(_,typesa,_,_),Ast0.DisjType(_,typesb,_,_)) ->
+         | (Ast0.DisjType(_,typesa,_,_),_) ->
              failwith "not allowed in the pattern of an isomorphism"
          | (Ast0.OptType(tya),Ast0.OptType(tyb))
          | (Ast0.UniqueType(tya),Ast0.UniqueType(tyb)) -> match_typeC tya tyb
@@ -835,6 +839,7 @@ let match_maker checks_needed context_required whencode_allowed =
        add_pure_binding name pure pure_sp_code.VT0.combiner_rec_declaration
          (function d -> Ast0.DeclTag d)
          d
+    | Ast0.MetaFieldList(name,_,pure) -> failwith "metafieldlist not supporte"
     | up ->
        if not(checks_needed) or not(context_required) or is_context d
        then
@@ -869,7 +874,7 @@ let match_maker checks_needed context_required whencode_allowed =
          | (Ast0.Typedef(stga,tya,ida,sc1),Ast0.Typedef(stgb,tyb,idb,sc)) ->
              conjunct_bindings (check_mcode sc1 sc)
                (conjunct_bindings (match_typeC tya tyb) (match_typeC ida idb))
-         | (Ast0.DisjDecl(_,declsa,_,_),Ast0.DisjDecl(_,declsb,_,_)) ->
+         | (Ast0.DisjDecl(_,declsa,_,_),_) ->
              failwith "not allowed in the pattern of an isomorphism"
          | (Ast0.Ddots(d1,None),Ast0.Ddots(d,None)) -> check_mcode d1 d
          |     (Ast0.Ddots(dd,None),Ast0.Ddots(d,Some wc)) ->
@@ -1828,6 +1833,8 @@ let instantiate bindings mv_bindings =
          | Common.Right(new_mv) ->
              Ast0.rewrap e
                (Ast0.MetaField(Ast0.set_mcode_data new_mv name, pure)))
+    | Ast0.MetaFieldList(name,lenname,pure) ->
+       failwith "metafieldlist not supported"
     | Ast0.Ddots(d,_) ->
        (try
          (match List.assoc (dot_term d) bindings with
@@ -2073,6 +2080,8 @@ let get_name = function
       (nm,function nm -> Ast.MetaExpListDecl(ar,nm,nm1))
   | Ast.MetaDeclDecl(ar,nm) ->
       (nm,function nm -> Ast.MetaDeclDecl(ar,nm))
+  | Ast.MetaFieldListDecl(ar,nm,nm1) ->
+      (nm,function nm -> Ast.MetaFieldListDecl(ar,nm,nm1))
   | Ast.MetaFieldDecl(ar,nm) ->
       (nm,function nm -> Ast.MetaFieldDecl(ar,nm))
   | Ast.MetaStmDecl(ar,nm) ->