[Linux-kernel-mentees] [PATCH 15/27] parsing_cocci: pretty_print_cocci: Reflect struct end attributes

Jaskaran Singh jaskaransingh7654321 at gmail.com
Sun May 31 15:26:09 UTC 2020


Struct end attributes are added to the SmPL AST. Print these changes in
pretty_print_cocci.ml.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
 parsing_cocci/pretty_print_cocci.ml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/parsing_cocci/pretty_print_cocci.ml b/parsing_cocci/pretty_print_cocci.ml
index e554a6df..aaea3f9d 100644
--- a/parsing_cocci/pretty_print_cocci.ml
+++ b/parsing_cocci/pretty_print_cocci.ml
@@ -580,7 +580,11 @@ and declaration d =
       close_box(); mcode print_string rp;
       print_string " "; mcode print_string eq;
       print_string " "; initialiser ini; mcode print_string sem
-  | Ast.TyDecl(ty,sem) -> fullType ty; mcode print_string sem
+  | Ast.TyDecl(ty,attr,sem) ->
+      fullType ty;
+      (if not (attr = []) then print_string " ");
+      print_between print_space (mcode print_string) attr;
+      mcode print_string sem
   | Ast.Typedef(stg,ty,id,sem) ->
       mcode print_string stg; print_string " ";
       print_named_type ty (fun _ -> typeC id);
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list