Struct end attributes are added to the SmPL AST. Reflect these changes
in unparse_ast0.ml.

Signed-off-by: Jaskaran Singh <[email protected]>
---
 parsing_cocci/unparse_ast0.ml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/parsing_cocci/unparse_ast0.ml b/parsing_cocci/unparse_ast0.ml
index ebe8084a..81bbb71a 100644
--- a/parsing_cocci/unparse_ast0.ml
+++ b/parsing_cocci/unparse_ast0.ml
@@ -440,7 +440,11 @@ and declaration d =
           print_string " ";
           mcode print_string eq; print_string " "; initialiser ini;
          mcode print_string sem
-      | Ast0.TyDecl(ty,sem) -> typeC ty; mcode print_string sem
+      | Ast0.TyDecl(ty,attr,sem) ->
+          typeC ty;
+          (if not (attr = []) then print_string " ");
+          print_between (fun _ -> print_string " ") (mcode print_string) attr;
+          mcode print_string sem
       | Ast0.Typedef(stg,ty,id,sem) ->
          mcode print_string stg; typeC ty; typeC id;
          mcode print_string sem
-- 
2.21.1

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to