On Fri, 12 May 2017, SF Markus Elfring wrote:

> >>> Maybe put parentheses around the second argument.  An isomorphism will
> >>> drop them and you will avoid whatever parsing issue is being encountered.
> >>
> >> I do not observe a desired improvement after such a SmPL code adjustment.
> >
> > Your change is not what I suggested either.  The second argument starts to
> > the right of one comma and ends to the left of the next one.
>
> I interpreted the “second one” as belonging to the ellipsis in the binary
> operator specification (for a moment).
>
> Now I observe that the following SmPL script variants work as desired
> in principle.
>
> @find_last_option@
> expression target;
> identifier action;
> @@
>  target = action(...,
>                  ( ...
> *                | __GFP_NOFAIL
>                  )
>                 );
>
>
> @find_flag@
> expression target;
> identifier action;
> @@
>  target = action(...,
>                  ( ...
> *                | __GFP_NOFAIL
>                  | ...
>                  ),
>                  ...);
>
>
> I find it just strange that extra parentheses are needed in such an use case
> at the moment.

... is used in a number of contexts in SmPL, and sometimes its use has to
be restricted to avoid parsing ambiguities.  I'm a bit surprised also that
it is a problem in this case.

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to