[Linux-kernel-mentees] [PATCH 04/27] parsing_cocci: unparse_ast0: Reflect struct end attributes

Jaskaran Singh jaskaransingh7654321 at gmail.com
Sun May 31 15:25:58 UTC 2020


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

Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
 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



More information about the Linux-kernel-mentees mailing list