It is possible for one rule to depend on the success or failure of another rule. There are four possibilities:

@foo_found disable all@
identifier foo;
@@
foo(...)
{
 <+...
  {
  ...
  return;
  }
 ...+>
}

@bar depends on foo_found@
@@
-bar()

any instances of the call bar() will only be removed when a match has occurred against a function called foo.

@stop_matches@
identifier lock_out
@@

lock_out

@foo_2_bar depends on never stop_matches@
@@

-foo();
+bar();

will only replace foo with bar if the source file does not contain any instance of an identifier named lock_out.

 
dependencies_between_patterns.txt · Last modified: 2010/03/14 14:57 by jll
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki