All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Cocci] [PATCH 1/2] parsing_c: Align C AST and Cocci AST for pointers
@ 2020-02-05 18:36 ` Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2020-02-05 18:36 UTC (permalink / raw)
  To: Jaskaran Singh, cocci; +Cc: linux-kernel-mentees

…
> +++ b/parsing_c/pretty_print_c.ml
> @@ -804,11 +804,12 @@ and pp_string_format (e,ii) =
>               (FunctionType (return=void, params=int i) *)
>            (*WRONG I THINK, use left & right function *)
>            (* bug: pp_type_with_ident_rest None t;      print_ident ident *)
> +          pp_type_left t;
>            pr_elem i;
>            iiqu +> List.iter pr_elem; (* le const est forcement apres le '*' *)
>            if iiqu <> [] || get_comments_after i <> []
>            then pr_space();
> -          pp_type_with_ident_rest ident t attrs Ast_c.noattr;
> +          print_ident ident
>
>        (* ugly special case ... todo? maybe sufficient in practice *)
>        | (ParenType ttop, [i1;i2]) ->

Are the source code comments still appropriate for this patch hunk?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-kernel-mentees] [Cocci] [PATCH 1/2] parsing_c: Align C AST and Cocci AST for pointers
@ 2020-02-05 18:36 ` Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2020-02-05 18:36 UTC (permalink / raw)
  To: Jaskaran Singh, cocci; +Cc: linux-kernel-mentees

…
> +++ b/parsing_c/pretty_print_c.ml
> @@ -804,11 +804,12 @@ and pp_string_format (e,ii) =
>               (FunctionType (return=void, params=int i) *)
>            (*WRONG I THINK, use left & right function *)
>            (* bug: pp_type_with_ident_rest None t;      print_ident ident *)
> +          pp_type_left t;
>            pr_elem i;
>            iiqu +> List.iter pr_elem; (* le const est forcement apres le '*' *)
>            if iiqu <> [] || get_comments_after i <> []
>            then pr_space();
> -          pp_type_with_ident_rest ident t attrs Ast_c.noattr;
> +          print_ident ident
>
>        (* ugly special case ... todo? maybe sufficient in practice *)
>        | (ParenType ttop, [i1;i2]) ->

Are the source code comments still appropriate for this patch hunk?

Regards,
Markus
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] [PATCH 1/2] parsing_c: Align C AST and Cocci AST for pointers
  2020-02-05 18:36 ` [Linux-kernel-mentees] " Markus Elfring
@ 2020-02-06 11:50   ` Jaskaran Singh
  -1 siblings, 0 replies; 4+ messages in thread
From: Jaskaran Singh @ 2020-02-06 11:50 UTC (permalink / raw)
  To: Markus Elfring; +Cc: linux-kernel-mentees, cocci

On Wed, 2020-02-05 at 19:36 +0100, Markus Elfring wrote:
> …
> > +++ b/parsing_c/pretty_print_c.ml
> > @@ -804,11 +804,12 @@ and pp_string_format (e,ii) =
> >               (FunctionType (return=void, params=int i) *)
> >            (*WRONG I THINK, use left & right function *)
> >            (* bug: pp_type_with_ident_rest None t;      print_ident
> > ident *)
> > +          pp_type_left t;
> >            pr_elem i;
> >            iiqu +> List.iter pr_elem; (* le const est forcement
> > apres le '*' *)
> >            if iiqu <> [] || get_comments_after i <> []
> >            then pr_space();
> > -          pp_type_with_ident_rest ident t attrs Ast_c.noattr;
> > +          print_ident ident
> > 
> >        (* ugly special case ... todo? maybe sufficient in practice
> > *)
> >        | (ParenType ttop, [i1;i2]) ->
> 
> Are the source code comments still appropriate for this patch hunk?
> 

I know the "le const est forcement" comment is still appropriate.

The bug comment above probably still is.

Not so sure about the WRONG I THINK comment. I'm using pp_type_left
here, but not pp_type_right. Of course, that is if the comment is in
that context.

Cheers,
Jaskaran.

> Regards,
> Markus

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-kernel-mentees] [Cocci] [PATCH 1/2] parsing_c: Align C AST and Cocci AST for pointers
@ 2020-02-06 11:50   ` Jaskaran Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Jaskaran Singh @ 2020-02-06 11:50 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Julia Lawall, linux-kernel-mentees, cocci

On Wed, 2020-02-05 at 19:36 +0100, Markus Elfring wrote:
> …
> > +++ b/parsing_c/pretty_print_c.ml
> > @@ -804,11 +804,12 @@ and pp_string_format (e,ii) =
> >               (FunctionType (return=void, params=int i) *)
> >            (*WRONG I THINK, use left & right function *)
> >            (* bug: pp_type_with_ident_rest None t;      print_ident
> > ident *)
> > +          pp_type_left t;
> >            pr_elem i;
> >            iiqu +> List.iter pr_elem; (* le const est forcement
> > apres le '*' *)
> >            if iiqu <> [] || get_comments_after i <> []
> >            then pr_space();
> > -          pp_type_with_ident_rest ident t attrs Ast_c.noattr;
> > +          print_ident ident
> > 
> >        (* ugly special case ... todo? maybe sufficient in practice
> > *)
> >        | (ParenType ttop, [i1;i2]) ->
> 
> Are the source code comments still appropriate for this patch hunk?
> 

I know the "le const est forcement" comment is still appropriate.

The bug comment above probably still is.

Not so sure about the WRONG I THINK comment. I'm using pp_type_left
here, but not pp_type_right. Of course, that is if the comment is in
that context.

Cheers,
Jaskaran.

> Regards,
> Markus

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-06 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 18:36 [Cocci] [PATCH 1/2] parsing_c: Align C AST and Cocci AST for pointers Markus Elfring
2020-02-05 18:36 ` [Linux-kernel-mentees] " Markus Elfring
2020-02-06 11:50 ` Jaskaran Singh
2020-02-06 11:50   ` [Linux-kernel-mentees] " Jaskaran Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.