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

[Linux-kernel-mentees] [PATCH 03/27] parsing_cocci: visitor_ast0: Visit struct end attributes

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

Struct end attributes are added to AST0 of SmPL. Visit these attributes
in the AST0 visitor.

Signed-off-by: Jaskaran Singh <redacted>
---
 parsing_cocci/visitor_ast0.ml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/parsing_cocci/visitor_ast0.ml b/parsing_cocci/visitor_ast0.ml
index 63241ffd..87b2b3f5 100644
--- a/parsing_cocci/visitor_ast0.ml
+++ b/parsing_cocci/visitor_ast0.ml
@@ -660,10 +660,11 @@ let visitor mode bind option_default
 	    let (sem_n,sem) = string_mcode sem in
 	    (multibind [stg_n;name_n;lp_n;args_n;rp_n;eq_n;ini_n;sem_n],
 	     Ast0.MacroDeclInit(stg,name,lp,args,rp,eq,ini,sem))
-	| Ast0.TyDecl(ty,sem) ->
+	| Ast0.TyDecl(ty,attr,sem) ->
 	    let (ty_n,ty) = typeC ty in
+	    let (attr_n,attr) = map_split_bind string_mcode attr in
 	    let (sem_n,sem) = string_mcode sem in
-	    (bind ty_n sem_n, Ast0.TyDecl(ty,sem))
+            (multibind [ty_n; attr_n; sem_n], Ast0.TyDecl(ty,attr,sem))
 	| Ast0.Typedef(stg,ty,id,sem) ->
 	    let (stg_n,stg) = string_mcode stg in
 	    let ((ty_id_n,ty),id) = named_type_typedef ty id in
-- 
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