[Linux-kernel-mentees] [PATCH 02/27] parsing_cocci: parser: Reflect struct end attributes

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


Struct end attributes are added to the SmPL AST. Parse these attributes
correctly in the SmPL parser.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
 parsing_cocci/parser_cocci_menhir.mly | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/parsing_cocci/parser_cocci_menhir.mly b/parsing_cocci/parser_cocci_menhir.mly
index 94e0b84a..63cb8b5e 100644
--- a/parsing_cocci/parser_cocci_menhir.mly
+++ b/parsing_cocci/parser_cocci_menhir.mly
@@ -1678,8 +1678,8 @@ the language is ambiguous: what is foo * bar; */
 /* The AST DisjDecl cannot be generated because it would be ambiguous with
 a disjunction on a statement with a declaration in each branch */
 decl_var:
-    t=ctype pv=TPtVirg
-      { [Ast0.wrap(Ast0.TyDecl(t,P.clt2mcode ";" pv))] }
+    t=ctype ar=attr_list pv=TPtVirg
+      { [Ast0.wrap(Ast0.TyDecl(t,ar,P.clt2mcode ";" pv))] }
   | TMetaDecl { [P.meta_decl $1] }
   | s=ioption(storage) t=ctype
       d=comma_list(direct_declarator(disj_ident)) pv=TPtVirg
@@ -1731,8 +1731,8 @@ decl_var:
 	  d }
 
 one_decl_var:
-    t=ctype pv=TPtVirg
-      { Ast0.wrap(Ast0.TyDecl(t,P.clt2mcode ";" pv)) }
+    t=ctype ar=attr_list pv=TPtVirg
+      { Ast0.wrap(Ast0.TyDecl(t,ar,P.clt2mcode ";" pv)) }
   | TMetaDecl { P.meta_decl $1 }
   | s=ioption(storage) t=ctype d=direct_declarator(disj_ident)
       a=attr_list pv=TPtVirg
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list