[Linux-kernel-mentees] [PATCH 22/32] parsing_c: pretty_print_c: Reflect Cast attributes

Julia Lawall julia.lawall at inria.fr
Sun May 3 19:32:36 UTC 2020



On Tue, 28 Apr 2020, Jaskaran Singh wrote:

> Cast attributes are added to the SmPL AST. Print these attributes in
> pretty_print_c.ml.
>
> Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
> ---
>  parsing_c/pretty_print_c.ml | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/parsing_c/pretty_print_c.ml b/parsing_c/pretty_print_c.ml
> index 99a7e0ed..96a11d72 100644
> --- a/parsing_c/pretty_print_c.ml
> +++ b/parsing_c/pretty_print_c.ml
> @@ -146,8 +146,9 @@ let mk_pretty_printers
>  	pp_expression e
>      | SizeOfType  (t),     [i1;i2;i3] ->
>          pr_elem i1; pr_elem i2; pp_type t; pr_elem i3
> -    | Cast    (t, e),      [i1;i2] ->
> -        pr_elem i1; pp_type t; pr_elem i2; pp_expression e
> +    | Cast    (t, e, a),      [i1;i2] ->

Less space in front of the [

julia

> +        pr_elem i1; pp_type t; pr_elem i2; pp_expression e;
> +        a +> pp_attributes pr_elem pr_space
>
>      | StatementExpr (statxs, [ii1;ii2]),  [i1;i2] ->
>          pr_elem i1;
> @@ -184,7 +185,7 @@ let mk_pretty_printers
>      | CondExpr (_,_,_) | Sequence (_,_) | Assignment (_,_,_)
>      | Postfix (_,_) | Infix (_,_) | Unary (_,_) | Binary (_,_,_)
>      | ArrayAccess (_,_) | RecordAccess (_,_) | RecordPtAccess (_,_)
> -    | SizeOfExpr (_) | SizeOfType (_) | Cast (_,_)
> +    | SizeOfExpr (_) | SizeOfType (_) | Cast (_,_,_)
>      | StatementExpr (_) | Constructor _
>      | ParenExpr (_) | New (_) | Delete (_,_)
>      | Defined (_)),_ -> raise (Impossible 95)
> --
> 2.21.1
>
>


More information about the Linux-kernel-mentees mailing list