Thread (28 messages) 28 messages, 1 author, 2020-05-31

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

From: Jaskaran Singh <hidden>
Date: 2020-05-31 15:27:58
Also in: cocci
Subsystem: the rest · Maintainer: Linus Torvalds

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

Signed-off-by: Jaskaran Singh <redacted>
---
 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

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help