Macrodecl attributes are added to the SmPL ASTs. Parse these attributes
in the SmPL parser and place them in the SmPL AST. The added production
only supports attributes before the semicolon.

Signed-off-by: Jaskaran Singh <[email protected]>
---
 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 db5661bd..d5d5df8c 100644
--- a/parsing_cocci/parser_cocci_menhir.mly
+++ b/parsing_cocci/parser_cocci_menhir.mly
@@ -1710,9 +1710,9 @@ decl_var:
       [Ast0.wrap(Ast0.Init(s,fn idtype,id,a,P.clt2mcode "=" q,e,
                           P.clt2mcode ";" pv))] }
   | s=ioption(storage) d=decl_ident o=TOPar e=eexpr_list_option c=TCPar
-      p=TPtVirg
+      ar=attr_list p=TPtVirg
       { [Ast0.wrap(Ast0.MacroDecl(s,d,P.clt2mcode "(" o,e,
-                                 P.clt2mcode ")" c,P.clt2mcode ";" p))] }
+                                 P.clt2mcode ")" c,ar,P.clt2mcode ";" p))] }
   | s=ioption(storage)
       d=decl_ident o=TOPar e=eexpr_list_option c=TCPar q=TEq i=initialize
       p=TPtVirg
@@ -1758,9 +1758,9 @@ one_decl_var:
       Ast0.wrap(Ast0.Init(s,fn idtype,id,a,P.clt2mcode "=" q,e,
                           P.clt2mcode ";" pv)) }
   | s=ioption(storage) d=decl_ident o=TOPar e=eexpr_list_option c=TCPar
-      p=TPtVirg
+      ar=attr_list p=TPtVirg
       { Ast0.wrap(Ast0.MacroDecl(s,d,P.clt2mcode "(" o,e,
-                                 P.clt2mcode ")" c,P.clt2mcode ";" p)) }
+                                 P.clt2mcode ")" c,ar,P.clt2mcode ";" p)) }
   | s=ioption(storage)
       d=decl_ident o=TOPar e=eexpr_list_option c=TCPar q=TEq i=initialize
       p=TPtVirg
-- 
2.21.1

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to