On Wed, 1 Jun 2016, Iago Abal wrote:
> What about adding a warning in parse_cocci.eval_virt ?
>
> if not (List.is_empty virt) && List.is_empty !Flag.defined_virtual_rules
> then <warning>
Actually, it's complex. Eval_virt doesn't have all the information. A
common scenario is when you do iteration. Then you can have some rules
that depend on a virtual rule that is added in the iteration call. But
the iteration call is ocaml or python code. The Coccinelle parser
doesn't know what that code contains.
It seems easier to just point the user to the fact that none of the
virtual rules are defined, if a failure occurs.
julia
>
> Iago
>
> On Wed, Jun 1, 2016 at 5:21 PM, Julia Lawall <[email protected]> wrote:
>
>
> On Wed, 1 Jun 2016, Iago Abal wrote:
>
> > The error is generated at parsing_cocci/get_constants2.ml but
> in several
> > places within that file. How are virtual rules represented in
> > parsing_cocci/ast_cocci.ml?
>
> There is just !Flags.defined_virtual_rules in the directory
> globals.
>
> Afterwards, they are just simplified away in the parsing process
> (parse_cocci.ml, function eval_depend). They aren't explicitly
> represented in the AST.
>
> julia
>
> >
> > Iago
> >
> > On Wed, Jun 1, 2016 at 4:54 PM, Julia Lawall
> <[email protected]> wrote:
> >
> >
> > On Wed, 1 Jun 2016, Iago Abal wrote:
> >
> > > That would help, where do you check virtual rules?
> >
> > To my recollection, they are just checked on the
> interpretation
> > of
> > relevant depends ons. But they could easily be checked
> for at
> > the time of
> > generating the message.
> >
> > julia
> >
> >
> >
> >
> >
>
>
>
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci