[Linux-kernel-mentees] [PATCH 10/27] parsing_cocci: compute_lines: Reflect struct end attributes

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


Struct end attributes are added to the SmPL AST. Reflect these changes
in compute_lines.ml.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
 parsing_cocci/compute_lines.ml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/parsing_cocci/compute_lines.ml b/parsing_cocci/compute_lines.ml
index 682e41a4..4f273307 100644
--- a/parsing_cocci/compute_lines.ml
+++ b/parsing_cocci/compute_lines.ml
@@ -747,10 +747,11 @@ and declaration d =
 	  let stg = Some (normal_mcode x) in
 	  mkres d (Ast0.MacroDeclInit(stg,name,lp,args,rp,eq,ini,sem))
 	    (promote_mcode x) (promote_mcode sem))
-  | Ast0.TyDecl(ty,sem) ->
+  | Ast0.TyDecl(ty,attr,sem) ->
       let ty = typeC ty in
+      let attr = List.map normal_mcode attr in
       let sem = normal_mcode sem in
-      mkres d (Ast0.TyDecl(ty,sem)) ty (promote_mcode sem)
+      mkres d (Ast0.TyDecl(ty,attr,sem)) ty (promote_mcode sem)
   | Ast0.Typedef(stg,ty,id,sem) ->
       let stg = normal_mcode stg in
       let ty = typeC ty in
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list