Re: [Cocci] [PATCH 14/26] parsing_cocci: adjust_pragmas: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall



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 
> ---
>  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
>
>
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


[Cocci] [PATCH 14/26] parsing_cocci: adjust_pragmas: Add cases for ParenType/FunctionType

2020-03-16 Thread Jaskaran Singh
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in adjust_pragmas.ml.

Signed-off-by: Jaskaran Singh 
---
 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))
+  | 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

___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci