coccinelle release 1.0.0-rc6
[bpt/coccinelle.git] / tests / regexp2.cocci
CommitLineData
951c7801
C
1@anyid@
2type t;
3identifier id;
4constant cst;
5fresh identifier new = id ## "_is_constant";
6@@
7
8t id = cst;
9+t new;
10
11@contains@
12type t;
13identifier anyid.id;
f3c4ece6 14constant anyid.cst =~ ".*FOO";
951c7801
C
15fresh identifier contains = id ##"_equals_cst_that_contains_FOO";
16@@
17
18t id = cst;
19+t contains;
20
21@nocontain@
22type t;
23identifier anyid.id;
f3c4ece6 24constant anyid.cst !=~ ".*FOO";
951c7801
C
25fresh identifier nocontain = id ##"_equals_cst_that_doesn_t_contain_FOO";
26@@
27
28t id = cst;
29+t nocontain;
30
31@endsby@
32type t;
33identifier anyid.id;
f3c4ece6 34constant anyid.cst =~ ".*FOO$";
951c7801
C
35fresh identifier endsby = id ##"_equals_cst_that_ends_by_FOO";
36@@
37
38t id = cst;
39+t endsby;
40
41@beginsby@
42type t;
43identifier anyid.id;
f3c4ece6 44constant anyid.cst =~ "^FOO";
951c7801
C
45fresh identifier beginsby = id ##"_equals_cst_that_begins_by_FOO";
46@@
47
48t id = cst;
49+t beginsby;