On Mon, 16 Mar 2020, Jaskaran Singh wrote:

> ParenType and FunctionType are now added to the SmPL ASTs. Add
> cases for these types in compute_lines.ml.
>
> Signed-off-by: Jaskaran Singh <[email protected]>
> ---
>  parsing_cocci/compute_lines.ml | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/parsing_cocci/compute_lines.ml b/parsing_cocci/compute_lines.ml
> index f4b6f4d8..8231a0e7 100644
> --- a/parsing_cocci/compute_lines.ml
> +++ b/parsing_cocci/compute_lines.ml
> @@ -574,6 +574,17 @@ and typeC t =
>        let rp2 = normal_mcode rp2 in
>        mkres t (Ast0.FunctionPointer(ty,lp1,star,rp1,lp2,params,rp2))
>       ty (promote_mcode rp2)
> +  | Ast0.ParenType(lp,ty,rp) ->
> +      let lp = normal_mcode lp in
> +      let rp = normal_mcode rp in
> +      let ty = typeC ty in
> +      mkres t (Ast0.ParenType(lp,ty,rp)) ty (promote_mcode rp)

The type is not the leftmost thing.  So the third argument should be
(promote_mcode lp).

julia

> +  | Ast0.FunctionType(ty,lp,params,rp) ->
> +      let ty = typeC ty in
> +      let lp = normal_mcode lp in
> +      let params = parameter_list (Some(promote_mcode lp)) params in
> +      let rp = normal_mcode rp in
> +      mkres t (Ast0.FunctionType(ty,lp,params,rp)) ty (promote_mcode rp)
>    | Ast0.Array(ty,lb,size,rb) ->
>        let ty = typeC ty in
>        let lb = normal_mcode lb in
> --
> 2.21.1
>
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to