[Linux-kernel-mentees] [PATCH 14/26] parsing_cocci: adjust_pragmas: Add cases for ParenType/FunctionType

Julia Lawall julia.lawall at inria.fr
Wed Mar 18 18:42:05 UTC 2020



On Mon, 16 Mar 2020, Jaskaran Singh wrote:

> ParenType and FunctionType are now added to the SmPL ASTs. Add
> cases for these types in adjust_pragmas.ml.
>
> Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
> ---
>  parsing_cocci/adjust_pragmas.ml | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/parsing_cocci/adjust_pragmas.ml b/parsing_cocci/adjust_pragmas.ml
> index 73b5ff5f..537150e7 100644
> --- a/parsing_cocci/adjust_pragmas.ml
> +++ b/parsing_cocci/adjust_pragmas.ml
> @@ -171,6 +171,10 @@ let rec left_ty t =
>    | Ast0.FunctionPointer(ty,lp1,star,rp1,lp2,params,rp2) ->
>        call_right left_ty ty t
>  	(function ty -> Ast0.FunctionPointer(ty,lp1,star,rp1,lp2,params,rp2))
> +  | Ast0.ParenType(lp,ty,rp) ->
> +      call_right left_ty ty t (function ty -> Ast0.ParenType(lp,ty,rp))

This doesn't look right, because the type is not the leftmost thing.

julia

> +  | Ast0.FunctionType(ty,lp,params,rp) ->
> +      call_right left_ty ty t (function ty -> Ast0.FunctionType(ty,lp,params,rp))
>    | Ast0.Array(ty,lb,size,rb) ->
>        call_right left_ty ty t (function ty -> Ast0.Array(ty,lb,size,rb))
>    | Ast0.Decimal(dec,lp,length,comma,precision_opt,rp) ->
> --
> 2.21.1
>
>


More information about the Linux-kernel-mentees mailing list