Hywan / atoum-instrumentation

The atoum\instrumentation library. Instrumentation for PHP (moles, code coverage…)
7 stars 2 forks source link

Negation in rules #2

Open jubianchi opened 10 years ago

jubianchi commented 10 years ago

To solve some bugs and avoid duplicating rules, I think we should be able to define negation in rules like:

To solve this bug, I think we should be able to define negation in rules like:

$rules[] = array(
    array('!public', ';'),
    array('\1', ';', 'mark_line(__LINE__)', ';'),
    $matching::SHIFT_REPLACEMENT_END
);

It would be even better if we could define some kind pattern like:

$rules[] = array(
    array('!(public|protected|private)', ';'),
    array('\1', ';', 'mark_line(__LINE__)', ';'),
    $matching::SHIFT_REPLACEMENT_END
);

The negated token will have to behave a bit like the fill symbol so we can replace it easily.

Those kind of rules could then be used to fix the behavior described in #1

Hywan commented 10 years ago

Hello :-),

Same as #1.