1111// Options:
1212
1313virtual context
14- virtual patch
1514virtual org
1615virtual report
1716
18- @initialize:python depends on !context && patch && !org && !report@
19-
20- import sys
21- print >> sys.stderr, "This semantic patch does not support the 'patch' mode."
22-
23- @depends on patch@
24- @@
25-
26- this_rule_should_never_matches();
27-
28- @ifm depends on !patch@
17+ @ifm@
2918expression *E;
3019statement S1,S2;
3120position p1;
@@ -35,15 +24,15 @@ if@p1 ((E == NULL && ...) || ...) S1 else S2
3524
3625// The following two rules are separate, because both can match a single
3726// expression in different ways
38- @pr1 depends on !patch expression@
27+ @pr1 expression@
3928expression *ifm.E;
4029identifier f;
4130position p1;
4231@@
4332
4433 (E != NULL && ... ) ? <+ ... E->f@ p1... +> : ...
4534
46- @pr2 depends on !patch expression@
35+ @pr2 expression@
4736expression *ifm.E;
4837identifier f;
4938position p2;
@@ -59,7 +48,7 @@ position p2;
5948
6049// For org and report modes
6150
62- @r depends on !context && !patch && (org || report) exists@
51+ @r depends on !context && (org || report) exists@
6352expression subE <= ifm.E;
6453expression *ifm.E;
6554expression E1,E2;
@@ -99,7 +88,7 @@ if@p1 ((E == NULL && ...) || ...)
9988}
10089else S3
10190
102- @script:python depends on !context && !patch && ! org && report@
91+ @script:python depends on !context && !org && report@
10392p << r.p;
10493p1 << ifm.p1;
10594x << ifm.E;
@@ -109,7 +98,7 @@ msg="ERROR: %s is NULL but dereferenced." % (x)
10998coccilib.report.print_report(p[0 ], msg)
11099cocci.include_match(False )
111100
112- @script:python depends on !context && !patch && org && !report@
101+ @script:python depends on !context && org && !report@
113102p << r.p;
114103p1 << ifm.p1;
115104x << ifm.E;
@@ -120,7 +109,7 @@ msg_safe=msg.replace("[","@(").replace("]",")")
120109cocci.print_main(msg_safe,p)
121110cocci.include_match(False )
122111
123- @s depends on !context && !patch && (org || report) exists@
112+ @s depends on !context && (org || report) exists@
124113expression subE <= ifm.E;
125114expression *ifm.E;
126115expression E1,E2;
@@ -159,7 +148,7 @@ if@p1 ((E == NULL && ...) || ...)
159148}
160149else S3
161150
162- @script:python depends on !context && !patch && ! org && report@
151+ @script:python depends on !context && !org && report@
163152p << s.p;
164153p1 << ifm.p1;
165154x << ifm.E;
@@ -168,7 +157,7 @@ x << ifm.E;
168157msg= " ERROR: %s is NULL but dereferenced." % (x)
169158coccilib.report.print_report(p[0 ], msg)
170159
171- @script:python depends on !context && !patch && org && !report@
160+ @script:python depends on !context && org && !report@
172161p << s.p;
173162p1 << ifm.p1;
174163x << ifm.E;
@@ -180,7 +169,7 @@ cocci.print_main(msg_safe,p)
180169
181170// For context mode
182171
183- @depends on context && !patch && ! org && !report exists@
172+ @depends on context && !org && !report exists@
184173expression subE <= ifm.E;
185174expression *ifm.E;
186175expression E1,E2;
@@ -223,23 +212,23 @@ else S3
223212// The following three rules are duplicates of ifm, pr1 and pr2 respectively.
224213// It is need because the previous rule as already made a "change".
225214
226- @ifm1 depends on !patch @
215+ @ifm1@
227216expression *E;
228217statement S1,S2;
229218position p1;
230219@@
231220
232221if@ p1 ((E == NULL && ... ) || ... ) S1 else S2
233222
234- @pr11 depends on !patch expression@
223+ @pr11 expression@
235224expression *ifm1.E;
236225identifier f;
237226position p1;
238227@@
239228
240229 (E != NULL && ... ) ? <+ ... E->f@ p1... +> : ...
241230
242- @pr12 depends on !patch expression@
231+ @pr12 expression@
243232expression *ifm1.E;
244233identifier f;
245234position p2;
@@ -253,7 +242,7 @@ position p2;
253242 sizeof(<+ ... E->f@ p2... +> )
254243)
255244
256- @depends on context && !patch && ! org && !report exists@
245+ @depends on context && !org && !report exists@
257246expression subE <= ifm1.E;
258247expression *ifm1.E;
259248expression E1,E2;
0 commit comments