[Linux-kernel-mentees] [PATCH v3 05/32] parsing_cocci: unparse_ast0: Reflect cast attributes
Jaskaran Singh
jaskaransingh7654321 at gmail.com
Fri May 29 12:06:35 UTC 2020
Cast attributes are added to the SmPL AST. Reflect these changes in
unparse_ast0.ml.
Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
parsing_cocci/unparse_ast0.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/parsing_cocci/unparse_ast0.ml b/parsing_cocci/unparse_ast0.ml
index 86b545b9..e735cb70 100644
--- a/parsing_cocci/unparse_ast0.ml
+++ b/parsing_cocci/unparse_ast0.ml
@@ -221,8 +221,10 @@ let rec expression e =
expression exp; mcode print_string pt; ident field
| Ast0.RecordPtAccess(exp,ar,field) ->
expression exp; mcode print_string ar; ident field
- | Ast0.Cast(lp,ty,rp,exp) ->
+ | Ast0.Cast(lp,ty,attr,rp,exp) ->
mcode print_string_box lp; typeC ty; close_box();
+ (if not (attr = []) then print_string " ");
+ print_between (fun _ -> print_string " ") (mcode print_string) attr;
mcode print_string rp; expression exp
| Ast0.SizeOfExpr(szf,exp) ->
mcode print_string szf; expression exp
--
2.21.1
More information about the Linux-kernel-mentees
mailing list