MetaAttribute is added to the SmPL AST. Reflect these changes in spgen.

Signed-off-by: Jaskaran Singh <jaskaran.si...@collabora.com>
---
 tools/spgen/source/meta_variable.ml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/spgen/source/meta_variable.ml 
b/tools/spgen/source/meta_variable.ml
index 40dcae9c2..70a9fe878 100644
--- a/tools/spgen/source/meta_variable.ml
+++ b/tools/spgen/source/meta_variable.ml
@@ -396,7 +396,6 @@ let metavar_combiner rn =
   let casefn = donothing in
   let topfn = donothing in
   let enumdeclfn = donothing in
-  let attributefn = donothing in
 
   (* --- These are shortened formatting functions that return MVSets --- *)
 
@@ -571,6 +570,13 @@ let metavar_combiner rn =
        )
     | _ -> fn v in
 
+  let attributefn c fn v =
+    match Ast0.unwrap v with
+    | Ast0.MetaAttribute(mc, idconstr, pure) ->
+        let constr = constraints ~rn idconstr in
+        meta_mc_format ~mc ~typ:"parameter " ~constr
+    | _ -> fn v in
+
   V0.flat_combiner bind option_default
     meta_mcode string_mcode const_mcode simpleAssign_mcode opAssign_mcode
     fix_mcode unary_mcode arithOp_mcode logicalOp_mcode cv_mcode sign_mcode
-- 
2.21.3

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to